A blank graduation year no longer blocks saving the profile - #335
Conversation
The Membership tab refused to save anything — school, major, skills, interests,
socials — unless a graduation year had been typed in, and the error it showed
("That graduation year does not look right") pointed at a field the member had
deliberately left empty.
The guard compared against `undefined` while the value is `null` for a blank
field: `null !== undefined` is true and `Number.isInteger(null)` is false, so
every save with an empty year fell into the error branch. `null` is the value
that CLEARS the column, so it has to pass.
Introduced by the review fix on #323, which changed the payload from
`undefined` to `null` to make fields clearable and did not move the guard with
it. Found while auditing the product against MVP.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_5904758b-c399-4d52-8109-fe3f16a9955c) |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Visit the preview URL for this PR (updated for commit b3caaf6): https://hacklytics2027--pr-335-y06hcpur.web.app (expires Sun, 16 Aug 2026 05:16:20 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c48ba34db61581e25fe2978355160b5eefe0e83f |
|
| Filename | Overview |
|---|---|
| sites/mainweb/components/portal/MembershipTab.tsx | Updates the validation guard to permit the existing null clearing value while preserving integer validation for non-empty input. |
Reviews (2): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
Found while auditing the product against MVP.
The Membership tab on
/settingsrefused to save anything — school, major, skills, interests, socials — unless a graduation year had been typed in, and the error it showed ("That graduation year does not look right") pointed at a field the member had deliberately left blank.nullis the value that clears the column, so it has to pass the guard. It was compared againstundefinedinstead.Introduced by the review fix on #323 — that change moved the payload from
undefinedtonullso fields could be cleared, and did not move this guard with it. The API-level suite could not catch it: the bug is in the client, and every server test callsmember.updatedirectly.typecheck · 426 tests · lint
--max-warnings 0· build.Note
Low Risk
Single-line client validation fix in the membership settings form; no auth, API, or data-layer changes.
Overview
Fixes a client-side validation bug on the Membership tab (
MembershipTab) where leaving graduation year empty blocked every profile save (school, major, skills, interests, socials) with "That graduation year does not look right."Blank input already maps to
nullto clear the column; the guard usedyear !== undefinedinstead of treatingnullas valid, soNumber.isInteger(null)failed and aborted save. The condition is nowyear !== nullso only non-empty invalid values are rejected.Reviewed by Cursor Bugbot for commit b3caaf6. Bugbot is set up for automated code reviews on this repo. Configure here.