Skip to content

PM-5447: Preserve started phase schedule shifts#129

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

PM-5447: Preserve started phase schedule shifts#129
jmgasper merged 1 commit into
developfrom
PM-5447-1

Conversation

@jmgasper

@jmgasper jmgasper commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What was broken
Switching an already launched development challenge from scheduled launch to immediately could still fail with the non-Design phase shortening error when an open phase already had an actualStartDate.

Root cause (if identifiable)
The previous fix validated recalculated phase dates, but started phases still ignored the requested scheduledStartDate during recalculation. When the UI submitted a whole phase window shifted earlier with the same duration, the helper applied the new end date against the old start date and misclassified the shift as a duration reduction.

What was changed
Carry the requested scheduled start date through phase recalculation for phases that have started but not ended, and remove that temporary field before returning persisted phase data.

Any added/updated tests
Added a phase-helper regression test for a started non-Design phase moving earlier with unchanged duration.

Validation
Focused phase-helper regression suite passes with 14 tests. Full npm test is blocked locally because DATABASE_URL is not configured by default, and the documented local Postgres migration path fails at migration 20251122120000_drop_phase_order_idx_allow_null_ai_reviewer because DefaultChallengeReviewer.isAIReviewer does not exist. Repo-wide prettier and standard lint commands are blocked by existing style drift across unrelated files. npm run build is unavailable because this package has no build script.

What was broken
Switching an already launched development challenge from scheduled launch to immediately could still fail with the non-Design phase shortening error when an open phase already had an actualStartDate.

Root cause (if identifiable)
The previous fix validated recalculated phase dates, but started phases still ignored the requested scheduledStartDate during recalculation. When the UI submitted a whole phase window shifted earlier with the same duration, the helper applied the new end date against the old start date and misclassified the shift as a duration reduction.

What was changed
Carry the requested scheduled start date through phase recalculation for phases that have started but not ended, and remove that temporary field before returning persisted phase data.

Any added/updated tests
Added a phase-helper regression test for a started non-Design phase moving earlier with unchanged duration.
@jmgasper jmgasper merged commit abf00e7 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