fix: let returning builders see and edit their current-season milestones#341
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Gaston Review
Verdict: Approved
Score: ████████░░ 8/10
Pull Request Summary
This PR makes two related changes: (1) it lets graduated builders see and edit their current-season milestones by widening the query filter from ACCEPTED-only to ACCEPTED | GRADUATED, gating writes on editsUnlocked, and (2) it introduces a "description ratchet" — unchanged milestone descriptions are grandfathered past validation rules, so legacy rows with empty or too-short descriptions don't block grantees from saving other edits. Deep links are also updated to include the applicationId for uniqueness across rounds, with a CSS selector fallback for backwards compatibility.
Review Summary
🟡 Warning — Potential TypeError on corrupted dynamic application details
In the milestones PATCH handler (line 431–433), the dynamic branch accesses appDetailsParsed.round[milestoneType] without optional chaining. If a stored dynamic application has malformed/missing round data, this will throw an unhandled TypeError and return a 500 instead of a graceful error. The legacy branch on the next line properly uses ?..
Solid, well-tested work. The ratchet pattern is non-trivial but the multiset approach handles edge cases (reordering, removal, net-new) cleanly, and the test suite covers them thoroughly. The one real concern is a potential null-dereference on corrupted dynamic app details in the milestones PATCH handler — low probability but easy to fix. Everything else is production-ready.
📌 4 inline comments
🟡 Warning: 1 · 🔵 Suggestion: 2 · ⚪ Nitpick: 1
🔍 Reviewed by Gaston
There was a problem hiding this comment.
Gaston Review
Verdict: Approved
Score: ████████░░ 8/10
Pull Request Summary
This PR lets graduated builders view and edit their current-season milestones by widening query filters from ACCEPTED-only to ACCEPTED | GRADUATED, gating writes on editsUnlocked. It introduces a description ratchet — unchanged milestone descriptions are grandfathered past validation, so legacy rows with empty/short descriptions don't block saving other edits. Deep links now include applicationId for uniqueness across rounds, with a CSS selector fallback for old links. Blank deliverable rows are also stripped client-side before submission.
The prior review's one real concern — missing optional chaining on the dynamic branch in the milestones PATCH handler — has been fixed. The ratchet pattern is non-trivial but implemented consistently across both write paths (full-application PUT and milestones PATCH), with the multiset approach handling reordering, removal, and net-new milestones cleanly. Client-side validation mirrors the server logic. Twelve new test cases cover the ratchet edge cases thoroughly. Everything here is production-ready.
🔍 Reviewed by Gaston
Problem
GoodBuilders S3 builders now in S4 reported the Milestones tab kept showing their old Season 3 milestones and that they could not edit.
Fix
Verification
Known edge left as is: stored legacy milestones containing blank item rows would fail an unchanged resubmit, but that is only reachable via raw API clients since both UIs filter blank rows before sending.