Conversation
What was broken When a Marathon Match member submitted again while an earlier scorer was still running, the earlier run was stopped without any member-visible terminal state, so that submission stayed in the "Preparing" state indefinitely. Reporting the stopped run required a status that is neither "in progress" nor "failed", but the member-safe review summation metadata allowlist dropped anything other than FAILED, IN PROGRESS and SUCCESS. Root cause normalizeTestStatus in buildSafeReviewSummationMetadata only recognized FAILED, IN PROGRESS and SUCCESS. A CANCELLED testStatus written by marathon-match-api-v6 was silently stripped from member-facing review summation and submission responses, so the UI never saw it and kept showing the generic preparing state. What was changed Added CANCELLED to the SafeTestStatus union and to the normalizeTestStatus allowlist so a cancelled Marathon Match scoring run survives metadata sanitization for both metadata.testStatus and metadata.testProgressDetails.status. No other metadata is newly exposed. Any added/updated tests - src/shared/utils/review-summation-metadata.util.spec.ts: new spec covering that a cancelled Marathon Match run keeps its status and progress details, and that unsupported free-form statuses are still dropped.
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.
What was broken
When a Marathon Match member submitted again while an earlier scorer task was still running, the earlier run was stopped without any member-visible terminal state, so that submission stayed in the Preparing state indefinitely (PM-5368).
Reporting the stopped run needs a status that is neither "in progress" nor "failed" — the ticket explicitly asks for cancelled, not failed. The member-safe review summation metadata allowlist dropped anything other than
FAILED,IN PROGRESSandSUCCESS, so there was no way to surface it.Root cause
normalizeTestStatusinbuildSafeReviewSummationMetadataonly recognizedFAILED,IN PROGRESSandSUCCESS. ACANCELLEDtestStatuswritten by marathon-match-api-v6 was silently stripped from member-facing review summation and submission responses, so neither community-app nor the platform-ui work app ever saw it and both kept showing the generic preparing state.What was changed
Added
CANCELLEDto theSafeTestStatusunion and to thenormalizeTestStatusallowlist, so a cancelled Marathon Match scoring run survives metadata sanitization for bothmetadata.testStatusandmetadata.testProgressDetails.status.No other metadata is newly exposed — the allowlist behaviour for every other field is unchanged, and unrecognized free-form statuses are still dropped.
Any added/updated tests
src/shared/utils/review-summation-metadata.util.spec.ts— new spec covering that a cancelled Marathon Match run keeps its status, process and progress details through sanitization, and that an unsupported free-form status is still dropped.Commands run:
pnpm lint,pnpm build,npx jest src/shared/utils(55 tests passing). The fullnpx jestrun has 8 pre-existing failures ondevelopinsubmission.service.spec.tsand 3 other suites, unchanged by this PR (verified by stashing the change and re-running).Related PRs
🤖 Generated with Claude Code