Repository navigation
feat: expose purge completion status - #378
Merged
Merged
Conversation
Preserve the backend's optional completion flag for single and filtered purges without inferring it from the deletion count. 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.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: None
What changed in this PR
Expose purge completion semantics to SDK callers by preserving the backend’s optional isComplete flag (true/false/undefined) in PurgeResult, with regression tests and release notes.
Changes:
- Extend
PurgeResultwith optionalisComplete?: booleanwhile keeping count-only construction compatible. - Map
PurgeInstancesResponse.isComplete(protobuf wrapper) intoPurgeResultin the gRPC client. - Add focused purge regression tests and document the feature in
CHANGELOG.md.
| File | Description |
|---|---|
| packages/durabletask-js/src/orchestration/orchestration-purge-result.ts | Adds optional isComplete to the public result type and constructor. |
| packages/durabletask-js/src/client/client.ts | Forwards protobuf isComplete wrapper value into PurgeResult. |
| packages/durabletask-js/test/client-purge.spec.ts | Adds regression tests covering true/false/undefined completion and existing purge behaviors. |
| CHANGELOG.md | Documents the newly exposed PurgeResult.isComplete semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kaibocai (kaibocai)
approved these changes
Oct 2, 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?
PurgeResult.isCompleteand forwardres.getIscomplete()?.getValue()for both single-instance and filtered purges.truemeans complete,falsemeans partial, and an absent protobuf wrapper becomesundefined(unknown).deletedInstanceCountandnew PurgeResult(count)compatible. Add JSDoc, release notes, and focused regression coverage.Why is this change needed?
A backend can delete some instances and return
isComplete: false. The deletion count alone cannot tell callers whether the purge finished, including when the count is zero. The completion flag already exists in the checked-in protobuf bindings; this change stops dropping it.This aligns with the .NET SDK's nullable completion contract and gRPC response mapping, using JavaScript
undefinedfor unknown.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):
Testing
Automated tests
v24.14.0, npm11.9.0.npm test -w @microsoft/durabletask-js -- --runTestsByPath test/client-purge.spec.tsfailed with the expected 8 missing-completion assertions, with 15 existing-behavior cases passing. Bothtrueandfalsefailed for both purge paths at counts 0 and 3.npm test -w @microsoft/durabletask-js -- --runTestsByPath test/client-purge.spec.ts test/in-memory-backend.spec.ts test/in-memory-backend-entities.spec.tspassed 98 tests across 3 suites, including all 23 purge regression tests.npm test -w durable-functions -- --runTestsByPath test/unit/client-query.spec.ts test/unit/client.spec.tspassed 37 tests across 2 suites.npm run build -w durable-functionspassed, including the core build and generated declaration files.npx --no-install eslint packages\durabletask-js\src\client\client.ts packages\durabletask-js\src\orchestration\orchestration-purge-result.ts packages\durabletask-js\test\client-purge.spec.ts.npx --no-install prettier --check --end-of-line auto CHANGELOG.md packages\durabletask-js\src\client\client.ts packages\durabletask-js\src\orchestration\orchestration-purge-result.ts packages\durabletask-js\test\client-purge.spec.ts. Existing client/changelog formatting also matched the remote-main baseline.git diff --checkpassed. Normal Husky/lint-staged ESLint hooks passed during commit.The new tests use the real generated protobuf response and a binary serialization/deserialization round trip, with only the unary RPC mocked. They cover explicit false versus absent wrappers, legacy construction, unchanged counts, request fields/recursive options, missing responses, service errors, and the existing local-only filter timeout without cancellation or retries.
Manual validation (only if runtime/behavior changed)
v24.14.0; local automated checks only.always-authconfiguration and dependency deprecation warnings were observed during the normal dependency restore; no registry/auth settings or dependencies were changed.Notes for reviewers
PurgeHistoryResultand HTTP responses are unchanged.mainat72b79a5a3012d630d2bdf5c2b0f75ef37ef63b39.