Conversation
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.
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
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.