Conversation
…to wangbill/rewind
There was a problem hiding this comment.
Pull request overview
This PR adds support for rewinding failed orchestration instances in the Durable Task JS SDK, allowing orchestrations to retry from their last known good state. This is useful for recovering from transient errors or debugging.
Changes:
- Added
rewindInstancemethod toTaskHubGrpcClientwith error handling for various failure scenarios - Created comprehensive end-to-end test suite covering both successful rewind operations and error cases
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/durabletask-js/src/client/client.ts | Implements the rewindInstance method with gRPC error handling and validation |
| test/e2e-azuremanaged/rewind.spec.ts | Adds E2E tests for rewind functionality including positive and negative test cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| req.setReason(reasonValue); | ||
| } | ||
|
|
||
| console.log(`Rewinding '${instanceId}' with reason: ${reason}`); |
There was a problem hiding this comment.
Console logging should not be used in production library code. Consider using a proper logging framework or removing this statement. If debugging output is needed, it should be optional and controlled through a logger interface.
There was a problem hiding this comment.
will address logging in separate pr
|
dts does not support rewind for standalone yet |
This pull request introduces support for rewinding failed orchestration instances in the Durable Task JS SDK, along with comprehensive end-to-end tests to validate the new functionality. The main focus is on enabling orchestrations that have failed to be retried from their last known good state, which is especially useful for recovering from transient errors or for debugging.
New feature: Rewind orchestration instances
rewindInstancemethod to theTaskHubGrpcClientclass, allowing users to rewind failed orchestration instances to retry them from the point of failure. The method includes detailed error handling for unsupported operations, invalid states, and missing instances.Testing: End-to-end tests for rewind functionality
rewind.spec.tswith both positive and negative test cases for therewindInstanceAPI. Tests cover scenarios such as successful rewinds, rewinds with custom reasons, and error cases like rewinding non-existent, completed, running, or terminated orchestrations, as well as invalid input handling.