Skip to content

PM-5368: allow CANCELLED Marathon Match test status through to members - #330

Merged
jmgasper merged 1 commit into
developfrom
PM-5368
Aug 26, 2026
Merged

PM-5368: allow CANCELLED Marathon Match test status through to members#330
jmgasper merged 1 commit into
developfrom
PM-5368

Conversation

@jmgasper

Copy link
Copy Markdown
Collaborator

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 PROGRESS and SUCCESS, so there was no way to surface it.

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 neither community-app nor the platform-ui work app ever saw it and both 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 — 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 full npx jest run has 8 pre-existing failures on develop in submission.service.spec.ts and 3 other suites, unchanged by this PR (verified by stashing the change and re-running).

Related PRs

  • marathon-match-api-v6: cancel a member's in-flight MM scorer before scoring their newest submission
  • community-app: show cancelled Marathon Match scoring in My Submissions
  • platform-ui: show cancelled Marathon Match test status in the work app submissions table

🤖 Generated with Claude Code

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.
@jmgasper
jmgasper merged commit 464cb99 into develop Aug 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant