feat: forward optional suspend and resume reasons - #372
Merged
Merged
Conversation
Preserve literal and empty reasons in core gRPC requests, Functions aliases, and in-memory history without changing lifecycle behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e0af01a5-0dfa-4e71-a660-c4186e65d7e0
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Adds optional suspend/resume reasons across core gRPC clients, in-memory testing, and Azure Functions aliases while preserving empty-string and omission semantics.
Changes:
- Forwards reasons through gRPC and classic aliases.
- Records reasons in in-memory history events.
- Adds regression tests, documentation, and changelog entries.
| File | Description |
|---|---|
packages/durabletask-js/test/in-memory-backend.spec.ts |
Tests reason preservation in in-memory history. |
packages/durabletask-js/test/client-suspend-resume.spec.ts |
Tests gRPC reason forwarding. |
packages/durabletask-js/src/utils/pb-helper.util.ts |
Builds reason-bearing history events. |
packages/durabletask-js/src/testing/test-client.ts |
Exposes reason-aware test APIs. |
packages/durabletask-js/src/testing/in-memory-backend.ts |
Records suspension and resumption reasons. |
packages/durabletask-js/src/client/client.ts |
Sends optional reasons in requests. |
packages/azure-functions-durable/test/unit/client.spec.ts |
Tests alias reason forwarding. |
packages/azure-functions-durable/src/client.ts |
Forwards reasons through classic aliases. |
packages/azure-functions-durable/CHANGELOG.md |
Documents alias behavior. |
CHANGELOG.md |
Documents the core API change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Retain both Functions changelog entries for suspend/resume reasons and nested task failure details. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e0af01a5-0dfa-4e71-a660-c4186e65d7e0
kaibocai (kaibocai)
approved these changes
Sep 25, 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
What changed?
reason?: stringtosuspendOrchestration()andresumeOrchestration(). Send literal strings through the existing protobuf fields, preserving empty strings and omitting undefined/runtime null. One-argument calls remain valid.Why is this change needed?
Issues / work items
Project checklist
CHANGELOG.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
AI verification (required if AI was used):
Human attestations are left for the reviewer; automated evidence follows.
Testing
Automated tests
npm exec --no -- jest --config jest.config.js --runInBand --silent --detectOpenHandles --runTestsByPath packages/durabletask-js/test/client-suspend-resume.spec.ts packages/durabletask-js/test/in-memory-backend.spec.ts packages/durabletask-js/test/orchestration_executor.spec.ts packages/azure-functions-durable/test/unit/client.spec.tsnpm run build -w durable-functionspassed, including the core build and emitted declarations.git diff --check origin/main...HEADpassed.Manual validation (only if runtime/behavior changed)
Notes for reviewers
reason={text}and are unchanged; their endpoints are host-owned. Azure-managed clients inherit the core API.6505acd5fce6fb6acfbb7560b4e15c2d0e8b42ea(main), not another parity PR.