Skip to content

Rewind client api#84

Merged
YunchuWang merged 3 commits intomainfrom
wangbill/rewind
Feb 2, 2026
Merged

Rewind client api#84
YunchuWang merged 3 commits intomainfrom
wangbill/rewind

Conversation

@YunchuWang
Copy link
Member

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

  • Added a new rewindInstance method to the TaskHubGrpcClient class, 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

  • Introduced a new test suite rewind.spec.ts with both positive and negative test cases for the rewindInstance API. 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.

Copilot AI review requested due to automatic review settings February 2, 2026 19:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rewindInstance method to TaskHubGrpcClient with 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}`);
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will address logging in separate pr

@YunchuWang
Copy link
Member Author

dts does not support rewind for standalone yet

@YunchuWang YunchuWang merged commit a11af70 into main Feb 2, 2026
3 of 10 checks passed
@YunchuWang YunchuWang deleted the wangbill/rewind branch February 2, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants