Skip to content

PM-5051: Rerate completed challenge updates#45

Open
jmgasper wants to merge 1 commit into
developfrom
PM-5051
Open

PM-5051: Rerate completed challenge updates#45
jmgasper wants to merge 1 commit into
developfrom
PM-5051

Conversation

@jmgasper

@jmgasper jmgasper commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

What was broken

The earlier member-api fix corrected Marathon Match rerate eligibility, but autopilot's challenge status-update path only triggered finance and point sync when it observed a challenge becoming COMPLETED. Challenges completed outside ChallengeCompletionService could miss the member-api challenge-level rerate call.

Root cause

The automatic rerate hook was added to ChallengeCompletionService, while PhaseScheduleManager's completed-status reconciliation path was left with only payment and point side effects.

What was changed

PhaseScheduleManager now calls memberApiService.rerateChallengeSubmitterRatings once when an update transitions a challenge to COMPLETED, including the path where overdue phase processing refreshes the challenge into COMPLETED. Member-api still decides whether the challenge is rated and which native or named rating dimensions apply.

Any added/updated tests

Updated PhaseScheduleManager unit coverage to assert the completed-status update path triggers submitter rerating once, skips non-completed statuses, and rerates when immediate phase closures complete the challenge.

Validation:

  • source ~/.nvm/nvm.sh && nvm use && pnpm test -- phase-schedule-manager.service.spec.ts
  • source ~/.nvm/nvm.sh && nvm use && pnpm test
  • source ~/.nvm/nvm.sh && nvm use && pnpm build
  • source ~/.nvm/nvm.sh && nvm use && pnpm exec eslint src/autopilot/services/phase-schedule-manager.service.ts src/autopilot/services/phase-schedule-manager.service.spec.ts
  • source ~/.nvm/nvm.sh && nvm use && pnpm lint was run, but it fails on existing unrelated lint errors in files outside this PM-5051 change, such as first2finish.service.spec.ts, phase-review.service.spec.ts, challenge-api.service.spec.ts, finance-api.service.ts, kafka.service.ts, review-api.service.ts, and review.service.spec.ts.

What was broken

The earlier member-api fix corrected Marathon Match rerate eligibility, but autopilot's challenge status-update path only triggered finance and point sync when it observed a challenge becoming COMPLETED. Challenges completed outside ChallengeCompletionService could miss the member-api challenge-level rerate call.

Root cause

The automatic rerate hook was added to ChallengeCompletionService, while PhaseScheduleManager's completed-status reconciliation path was left with only payment and point side effects.

What was changed

PhaseScheduleManager now calls memberApiService.rerateChallengeSubmitterRatings once when an update transitions a challenge to COMPLETED, including the path where overdue phase processing refreshes the challenge into COMPLETED. Member-api still decides whether the challenge is rated and which native or named rating dimensions apply.

Any added/updated tests

Updated PhaseScheduleManager unit coverage to assert the completed-status update path triggers submitter rerating once, skips non-completed statuses, and rerates when immediate phase closures complete the challenge.
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