Repository navigation
Conversation
What was broken Restored Marathon Match and TCO competitions appeared in profile history while wata's summary still reported 5 challenges and 1 win, as reported by QA. Root cause The summary trusted persisted aggregate counters even when visible history contained additional competitions and first-place finishes. The existing missing-win fallback did not repair nonzero stale totals. What was changed Reconcile public Marathon Match totals with the existing visible history read path, preserving its completion, placement, and duplicate-handling rules. Retain larger stored totals when history is partial. Update Data Science and overall totals and the MM submission fallback before selecting response fields. Preserve ratings and private-group totals. Document the read behavior. Any added/updated tests Add nine regressions for restored rounds, zero/stale counters, partial/empty history, merged MM aggregates, duplicate and cancelled rounds, winner-derived history, private groups, field filtering, and rating preservation. All 51 statistics tests, pnpm lint, pnpm build, and git diff --check pass. The full pnpm test run has 240 passing and 22 existing failures; clean develop has 231 passing and the same 22 failures. These require skills DB fixtures, Auth0/bus test configuration, and updates to existing validation assertions.
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
The earlier restoration made wata's missing Marathon Match/TCO competitions visible. QA confirmed the additional cards but reported that the API still returned 5 challenges and 1 win. This follow-up preserves the restored history and corrects the summary counters.
Local history, local/remote branches, and GitHub PR references were searched for PM-6577; no ticket-specific earlier branch or PR was found. The existing history filtering and reconciliation changes were reviewed, and this fresh branch starts from current
develop.Root cause
Member stats used persisted challenge/win counters independently of the visible history pipeline. The existing win hydration only filled missing values, leaving stale nonzero totals unchanged. A read-only check of the dev API also showed a mismatch: 20 visible competitions with five first-place finishes, but four aggregate wins.
What was changed
src/services/StatisticsService.ts: raise public Marathon Match totals to the minimum established by the existing visible history response, reusing its completion, placement, and legacy/canonical deduplication rules. Preserve larger totals when historical data is partial.ReadMe.md: document the reconciliation behavior.test/unit/StatisticsService.test.js: add nine regression cases. The screenshot-based fixture now returns 20 challenges and 6 wins instead of 5 and 1.Any added/updated tests
Nine new cases cover restored TCO rounds, stale and zero counters, partial and empty history, merged Development/MM aggregates, duplicate and cancelled rounds, winner-derived history/placements, and private groups. Assertions also cover parent totals, submissions, field selection, unchanged SRM stats, and preserved ratings/ranks/volatility.
Validation used Node 26.5.1 via
nvm use, existing local dependencies, and an isolated PostgreSQL 16 database:NODE_ENV=test pnpm exec mocha -t 20000 --require ts-node/register/transpile-only test/unit/StatisticsService.test.js --exit: 51 passing.pnpm lint,pnpm build, andgit diff --check: passed.pnpm test: 240 passing, 22 failing. A cleandevelopworktree has 231 passing and the identical 22 failing tests. Four failures need skills-table fixtures, one needs Auth0/bus test configuration, and 17 are existing validation-message assertions. No new full-suite failures were introduced; the full suite is not green.No UI change or rating replay is required. This adds a public MM history read when returning MM aggregates; other subtracks and private-only reads skip the reconciliation.