fix: add missing action types to non-determinism method names#271
Open
YunchuWang wants to merge 2 commits into
Open
fix: add missing action types to non-determinism method names#271YunchuWang wants to merge 2 commits into
YunchuWang wants to merge 2 commits into
Conversation
Add SENDEVENT, SENDENTITYMESSAGE, and TERMINATEORCHESTRATION cases to the getMethodNameForAction() switch statement. Without these cases, non-determinism errors involving entity operations or sendEvent would crash with an unhelpful 'Unknown action type' error instead of the proper NonDeterminismError diagnostic message. Also adds comprehensive unit tests for all exported helper functions in the worker/index.ts module. Fixes #233 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves non-determinism diagnostics in the Durable Task JS worker by ensuring getMethodNameForAction() can produce method-name strings for all currently relevant OrchestratorAction variants, preventing “Unknown action type” crashes in the non-determinism error path.
Changes:
- Add missing
OrchestratorActiontype mappings forSENDEVENT,SENDENTITYMESSAGE, andTERMINATEORCHESTRATIONingetMethodNameForAction(). - Add a new Jest test suite covering worker helper functions (including the newly added mappings) to prevent regressions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/durabletask-js/src/worker/index.ts | Extends action-type → method-name mapping to cover additional orchestrator action variants used in non-determinism error reporting. |
| packages/durabletask-js/test/worker-helpers.spec.ts | Adds unit tests for worker helper functions, including coverage for the newly mapped action types. |
Return user-facing API method names for SendEntityMessage action subtypes in non-determinism diagnostics, including callEntity, signalEntity, lockEntities, and lockRelease. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 #233