Repository navigation
Await export job deletion before returning success - #837
Merged
wangbill (YunchuWang) merged 2 commits intoNov 5, 2026
Merged
Conversation
Wait for the entity deletion command to complete successfully before starting the existing best-effort linked orchestration cleanup. Propagate command failures and caller cancellation, with focused regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes that await delete-command completion before linked-orchestration cleanup.
No open issues 🎉
What changed in this PR
This PR makes the Export History client wait for the delete command to complete successfully before starting linked-orchestration cleanup, rather than treating command submission as completion.
Changes:
- Await the delete command using its instance ID and the caller’s cancellation token.
- Require
Completedstatus and propagate failures through the existing logging and error-handling path. - Expand regression tests for ordering, unsuccessful statuses, RPC errors, cancellation, and graceful linked-orchestration
NotFoundhandling.
| File | Description |
|---|---|
test/ExportHistory.Tests/Client/DefaultExportHistoryJobClientTests.cs |
Strengthens deletion tests to verify completion ordering, failure propagation, cancellation, and cleanup behavior. |
src/ExportHistory/Client/DefaultExportHistoryJobClient.cs |
Awaits and validates delete-command completion before linked-orchestration cleanup. |
Review effort: Balanced
Varshitha Bachu (bachuv)
approved these changes
Nov 5, 2026
wangbill (YunchuWang)
deleted the
yunchuwang-export-deletion-acknowledgement
branch
November 5, 2026 23:19
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?
ExecuteExportJobOperationOrchestratorcommand that executesExportJob.Delete, and await its completion with inputs/outputs and the caller's cancellation token before starting linked-orchestration cleanup.OrchestrationRuntimeStatus.Completed; otherwise throw anInvalidOperationExceptioncontaining the job ID and available failure message, using the existing client error logging/rethrow path.NotFoundhandling.Why is this change needed?
DeleteAsynccould return successfully while the delete command was still pending and never observe its failure.CreateAsyncand the scheduled-task client'sDeleteAsync.Issues / work items
Project checklist
release_notes.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
src/ExportHistory/Client/DefaultExportHistoryJobClient.csandtest/ExportHistory.Tests/Client/DefaultExportHistoryJobClientTests.cs.AI verification (required if AI was used):
The verification above was performed by the coding agent.
Testing
Automated tests
dotnet restore .\test\ExportHistory.Tests\ExportHistory.Tests.csproj --configfile .\nuget.config --verbosity minimal— passed after the initial no-restore run found missing assets in the new worktree.dotnet test .\test\ExportHistory.Tests\ExportHistory.Tests.csproj --no-restore --filter FullyQualifiedName~DefaultExportHistoryJobClientTests --verbosity minimal— original baseline: 13 passed; final implementation: 21 passed, 0 failed, 0 skipped.dotnet test .\test\ExportHistory.Tests\ExportHistory.Tests.csproj --no-restore --filter 'FullyQualifiedName~DefaultExportHistoryJobClientTests&FullyQualifiedName~DeleteAsync' --verbosity minimal— expected pre-fix failure: all 10 strengthened deletion cases failed against unchanged production code. These cases are included in the final 21 passing tests above.dotnet build .\src\ExportHistory\ExportHistory.csproj --configuration Release --no-restore --no-incremental --verbosity minimal— passed fornet6.0,net8.0, andnet10.0; 0 errors, 258 analyzer/documentation warnings in existing code.git diff --check— passed.dotnet format whitespace . --folder --include .\src\ExportHistory\Client\DefaultExportHistoryJobClient.cs .\test\ExportHistory.Tests\Client\DefaultExportHistoryJobClientTests.cs --verify-no-changes --verbosity minimal— reports only the existingFINALNEWLINEconflict:.editorconfigsetsinsert_final_newline = false, whereas StyleCop SA1518 requires a trailing newline. Both original files already have trailing newlines. Trailing newlines were retained rather than changing repository-wide configuration or adding SA1518 warnings; all other scoped whitespace checks are clean.Manual validation (only if runtime/behavior changed)
DefaultExportHistoryJobClientexercised with MoqDurableTaskClientdependencies; no live service.DeleteAsyncstays incomplete and does not terminate/purge the linked orchestration. Complete that command successfully: linked termination, completion wait, and purge are each invoked once.Failed,Terminated,Pending,Running, orSuspended, or throw command-wait RPCNotFound/Unavailable: the error reaches the caller and linked cleanup is not started. The failure message is preserved when available.NotFoundafter successful deletion still completes gracefully and skips purge.Notes for reviewers
mainatf7041c032834ec72a1a3653803a58ab9fb354472; no dependency on the external-event lifetime or connection-diagnostics work. All 16 active PRs (including drafts) were rechecked for export-history file overlap before publication; none matched.