fix: handle EntityUnlockSent replay events#268
Merged
Conversation
Add missing ENTITYUNLOCKSENT case to the orchestration executor's processEvent switch statement. Previously, EntityUnlockSent history events were silently dropped during replay, causing stale unlock actions to accumulate in _pendingActions and be re-sent to the sidecar on every subsequent replay of orchestrations using entity locks. The fix follows the same validateEntityAction pattern used by all other entity event handlers (EntityOperationCalled, EntityLockRequested, etc.) to properly validate and clean up the pending action. Fixes #235 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
YunchuWang
force-pushed
the
copilot-finds/bug/fix-entity-unlock-sent-replay
branch
from
June 11, 2026 20:57
5a63fc0 to
8ad5e98
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a replay bug in the Durable Task JS orchestration executor by adding explicit handling for EntityUnlockSent history events, ensuring unlock actions emitted during critical-section exit are properly matched and removed from _pendingActions during replay (avoiding duplicate unlock messages being re-sent to the sidecar).
Changes:
- Add a
ENTITYUNLOCKSENTcase to the executor event switch and validate/remove the corresponding pending unlock action. - Add a regression test that simulates multi-pass replay including
EntityUnlockSentand asserts no stale unlock actions are returned.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/durabletask-js/src/worker/orchestration-executor.ts | Adds ENTITYUNLOCKSENT replay handling via validateEntityAction to clear pending unlock actions. |
| packages/durabletask-js/test/entity-locking.spec.ts | Adds a regression test that reproduces replay behavior and verifies unlock actions don’t persist across replays. |
kaibocai
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #235