Skip to content

PM-5780: Keep My Submissions count stable - #7251

Open
jmgasper wants to merge 1 commit into
developfrom
PM-5780
Open

PM-5780: Keep My Submissions count stable#7251
jmgasper wants to merge 1 commit into
developfrom
PM-5780

Conversation

@jmgasper

@jmgasper jmgasper commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

What was broken

For Marathon Match challenges with multiple attempts, the My Submissions badge showed the correct total while that tab was open, then dropped to the latest-only count after visiting the Submissions tab.

Root cause

The My Submissions and Submissions tabs replace the same grouped Marathon Match submissions state. The Submissions tab intentionally loads only each member's latest attempt for performance, but the badge used the loaded attempts array length instead of the total submissionCount returned with the latest row.

What was changed

The challenge detail container now derives a dedicated My Submissions count from the logged-in member's submissionCount, falling back to the loaded attempts length when needed. That stable count is passed through the header and displayed by both desktop and mobile tab badges. The latest-only loading optimization remains unchanged.

Any added/updated tests

  • Added container regression coverage for a latest-only row with one loaded attempt and a total count of three.
  • Added tab selector coverage confirming the badge renders the total independently of the loaded attempts array.
  • Verified with npm test, npm run lint, and npm run build under Node 24.18.0.

What was broken

The My Submissions badge showed the full attempt count on its own tab, then dropped to the latest-only count after visiting the Submissions tab.

Root cause

Both tabs replace the same Marathon Match submissions state. The badge read the loaded attempts array length, even though the latest-only response carries the member's total submissionCount separately.

What was changed

Derive a dedicated My Submissions count from submissionCount with a loaded-attempt fallback, pass it through the challenge header, and use it for desktop and mobile badges.

Any added/updated tests

Added regression coverage for deriving the total from a latest-only response and rendering that total independently of the loaded attempts array.
@jmgasper
jmgasper requested a review from kkartunov as a code owner August 4, 2026 06:55
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