Skip to content

PM-5457: Backfill duplicate challenge history display fields#141

Merged
jmgasper merged 1 commit into
developfrom
PM-5457
Jul 1, 2026
Merged

PM-5457: Backfill duplicate challenge history display fields#141
jmgasper merged 1 commit into
developfrom
PM-5457

Conversation

@jmgasper

@jmgasper jmgasper commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What was broken
Development challenge history cards could render without placement or rating even when the same challenge had those display values under a configured rating path such as DATA_SCIENCE / AI Engineering.

Root cause (if identifiable)
The stats history response grouped duplicate challenge rows by track and type without sharing display fields between the source-track row and the rating-path row. Profile pages that displayed the source-track history saw the metadata-only row and rendered blank stats.

What was changed
The unified stats history response now backfills only missing placement and newRating values from another history row with the same challenge id. Existing values are preserved, so a source-track rating is not overwritten by a rating-path rating.

Any added/updated tests
Added a stats history unit test covering duplicate Development / Challenge and DATA_SCIENCE / AI Engineering rows, including preserving an existing Development rating while copying missing placement.

Validation run:

  • pnpm exec mocha -t 20000 test/unit/StatsDimensionHelper.test.js --exit passed.
  • pnpm lint passed.
  • pnpm test ran with placeholder Prisma URLs and reported 152 passing tests, then failed four DB-backed member service hooks because no PostgreSQL server was available at localhost:5432.
  • pnpm build could not run because this package does not define a build command.

What was broken
Development challenge history cards could render without placement or rating even when the same challenge had those display values under a configured rating path such as DATA_SCIENCE / AI Engineering.

Root cause (if identifiable)
The stats history response grouped duplicate challenge rows by track and type without sharing display fields between the source-track row and the rating-path row. Profile pages that displayed the source-track history saw the metadata-only row and rendered blank stats.

What was changed
The unified stats history response now backfills only missing placement and newRating values from another history row with the same challenge id. Existing values are preserved, so a source-track rating is not overwritten by a rating-path rating.

Any added/updated tests
Added a stats history unit test covering duplicate Development / Challenge and DATA_SCIENCE / AI Engineering rows, including preserving an existing Development rating while copying missing placement.
@jmgasper jmgasper marked this pull request as ready for review July 1, 2026 22:50
@jmgasper jmgasper merged commit 232567e into develop Jul 1, 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