Skip to content

PM-5793: Restore downloaded profile ratings - #152

Merged
jmgasper merged 1 commit into
developfrom
PM-5793-1
Aug 3, 2026
Merged

PM-5793: Restore downloaded profile ratings#152
jmgasper merged 1 commit into
developfrom
PM-5793-1

Conversation

@jmgasper

@jmgasper jmgasper commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What was broken

The first PM-5793 implementation caused downloaded profiles to omit the entire Topcoder Activity stats list in the application runtime. It also did not include the Data Science and configured rating-path ratings shown by Profiles.

Root cause (if identifiable)

app-bootstrap replaces the global Promise with Bluebird. Bluebird's allSettled returns PromiseInspection objects instead of native { status, value } records, so the earlier code passed undefined stats to the PDF mapper. The mapper also covered only Development, Design, Testing, and SRM.

What was changed

  • Replaced the incompatible allSettled handling with Bluebird-compatible required-stats and optional-history resolution.
  • Added native and configured Data Science rating rows using the same rating selection, history-aware counts, and ordering rules as Profiles.
  • Kept SRM activity under Competitive Programming and AI Engineering under Development.
  • Rendered ratings alongside the existing win, submission, and challenge counts in downloaded profiles.

Any added/updated tests

  • Expanded ProfileStats.test.js to cover the reported track totals, Data Science/SRM separation, native and configured ratings, history-aware counts, Profiles ordering and tie-breaks, AI Engineering de-duplication, Bluebird/native Promise interoperability, optional-history fallback, and PDF text rendering.
  • Focused PM-5793 suite: 9 passing.
  • Lint, build, and TypeScript no-output checks pass.
  • Full-suite comparison produced 224 passing tests and the same 17 pre-existing Joi message assertion failures documented on the prior PR/base; the ticket-specific changes add no new failures.

What was broken

Downloaded profiles could omit all Topcoder Activity stats after the first PM-5793 change, and rated Data Science paths were not included even when Profiles displayed them.

Root cause (if identifiable)

The service used Promise.allSettled while app-bootstrap replaces the global Promise with Bluebird. Bluebird returns PromiseInspection objects rather than native status/value records, so the mapper received no stats. The first mapper also handled only the legacy tracks and SRM.

What was changed

Resolve required stats and optional history with Bluebird-compatible Promise.all behavior, map native and configured Data Science ratings with Profiles history/count/order rules, and render ratings in PDF activity rows.

Any added/updated tests

Expanded ProfileStats regression coverage for the supplied totals, Data Science and SRM separation, rating selection and ordering, AI de-duplication/tie-breaks, Bluebird/native promise resolution, optional-history fallback, and PDF rating text.
@jmgasper
jmgasper merged commit a683a86 into develop Aug 3, 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