Skip to content

A blank graduation year no longer blocks saving the profile - #335

Merged
aamoghS merged 3 commits into
mainfrom
fix/profile-save-blocked
Aug 9, 2026
Merged

A blank graduation year no longer blocks saving the profile#335
aamoghS merged 3 commits into
mainfrom
fix/profile-save-blocked

Conversation

@aamoghS

@aamoghS aamoghS commented Aug 9, 2026

Copy link
Copy Markdown
Member

Found while auditing the product against MVP.

The Membership tab on /settings 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 blank.

const year = form.graduationYear.trim() ? Number(form.graduationYear) : null;
if (year !== undefined && !Number.isInteger(year)) {  }   // null !== undefined

null is the value that clears the column, so it has to pass the guard. It was compared against undefined instead.

Introduced by the review fix on #323 — that change moved the payload from undefined to null so 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 calls member.update directly.

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 null to clear the column; the guard used year !== undefined instead of treating null as valid, so Number.isInteger(null) failed and aborted save. The condition is now year !== null so 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.

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.
@cursor

cursor Bot commented Aug 9, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions Bot added the bug Something isn't working label Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

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

@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown

Greptile Summary

The PR corrects client-side graduation-year validation so a blank value can clear the field without blocking the entire membership profile save.

  • Treats null as the valid representation of a blank graduation year.
  • Continues rejecting non-empty values that are not integers.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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

@aamoghS
aamoghS merged commit ef8ad3a into main Aug 9, 2026
1 check passed
@aamoghS
aamoghS deleted the fix/profile-save-blocked branch August 9, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant