Repository navigation
Preserve official Marathon Match standings across history and rating paths - #166
Merged
Merged
Conversation
jmgasper
marked this pull request as ready for review
October 16, 2026 04:28
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.
Marathon Match history can show the wrong placement when provisional/example reviews have a null
isFinalflag, official standings are recomputed from an incomplete set of competitors, or paid winner positions overwrite stored standings. For example, an official seventh place can become second from a partial review pool or fourth from prize eligibility.Exclude provisional/example scores from both MM result queries while retaining unmarked legacy finals. Preserve official placements in native and configured MM rating paths. Keep existing positive MM standings when the profile API enriches history and when the completed-challenge bulk backfill supplements history, including unrated events. Missing standings still use the existing fallback; other challenge types and authoritative legacy-history imports retain their behavior.
Validation: lint and build pass; 91 unit tests pass across the rating engine, statistics service, and bulk recalculation helpers. Regressions cover provisional contamination, partial competitor pools, unrated official standings, and supplemental paid-winner backfills. Production query checks used the NASA final reviews and PostgreSQL fixtures.
The runtime changes are deployed as a minimal overlay on the prior production image. Separately verified data repair corrected 66,578 history rows for 8,636 members and restored 384 missing source submission placements. Public API verification checked 2,144 entries across 21 profiles. Participation, ratings, and summaries were unchanged; rating replay is a separate follow-up. The bulk-script safeguard in this PR must be used for future manual rebuilds.