Conversation
What was broken Member profile stats could show stale win totals for Development and AI Engineering when the stats aggregate disagreed with the placement history shown on the same profile screens. Root cause The profiles aggregation helper trusted any nonzero aggregate win count before consulting history, so stale aggregates could count non-first placements as wins or undercount first-place history rows. What was changed Profile subtrack summaries now use placement-bearing history as the source for wins and only fall back to aggregate wins when history has no placement data. The compact Member Stats block now passes stats history into the same aggregation path used by the detail pages. Any added/updated tests Added regression coverage for stale nonzero aggregate wins being overridden by placement history, while preserving aggregate wins when legacy history rows do not include placement data.
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
Member profile stats could show stale win totals for Development and AI Engineering when the aggregate win count disagreed with the placement history displayed on the profile.
Root cause
The profiles aggregation helper preferred any nonzero aggregate win count over placement history. When the aggregate was stale, the UI could show second-place finishes as wins or miss additional first-place history rows.
What was changed
Subtrack summaries now use placement-bearing history as the authoritative source for wins and only fall back to aggregate wins when history has no placement data. The compact Member Stats block now passes stats history into the same aggregation path used by detail pages.
Any added/updated tests
Added regression tests for stale nonzero aggregate wins being overridden by placement history and for preserving aggregate wins when legacy history rows have no placement data.
Validation run:
Full yarn test:no-watch was also run. The profiles tests passed, but the full repo run still fails in unrelated apps/work suites that are outside this change, including engagement-editor.schema.spec.ts, PaymentFormModal.spec.tsx, and ChallengeEditorForm.spec.tsx.