Skip to content

Stop application forms from sending isSelected (approval reset bug) - #351

Merged
gregv merged 1 commit into
developfrom
fix/application-forms-drop-isselected
Aug 21, 2026
Merged

Stop application forms from sending isSelected (approval reset bug)#351
gregv merged 1 commit into
developfrom
fix/application-forms-drop-isselected

Conversation

@gregv

@gregv gregv commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Problem

Editing and re-submitting an application silently un-approved the applicant: four of the five forms sent isSelected: false from their initial form state on every submit (mentor/volunteer via ...formData spread, sponsor hardcoded in the payload, hacker round-tripped it), and the backend honored a client-supplied value.

Changes

  • Remove isSelected from initialFormData in mentor / volunteer / sponsor / hacker forms, the hardcoded payload field in sponsor, and the hydration round-trip in hacker — with comments so it doesn't get "helpfully" re-added.
  • Remove judge's vestigial selected form field and its dead <input type="hidden"> (the form submits via fetch; the input contributed nothing but the stray field was persisted to Firestore on every judge submit).
  • The isSelected React state used for UI gating (check-in QR, feedback CTA) is a separate variable and is untouched — no behavior change for approved users.

Pairs with

opportunity-hack/backend-ohack.dev#268 — the load-bearing half: the backend now strips staff-owned fields (isSelected, check-in, refund bookkeeping) from all self-service submits, which also covers stale localStorage drafts and the decline-the-restore-prompt path this frontend change can't reach. No deploy-order constraint in either direction.

Testing

  • ESLint clean on all five forms.
  • Verified no remaining formData.isSelected / formData.selected reads anywhere in src/.

🤖 Generated with Claude Code

Every application edit was sending isSelected: false from the form's
initial state (sponsor hardcoded it in the payload), which the backend
used to honor — silently un-approving approved mentors, judges,
volunteers, and sponsors on every update.

- Remove isSelected from initialFormData in mentor/volunteer/sponsor/
  hacker forms, the hardcoded payload field in sponsor, and the
  hydration round-trip in hacker.
- Remove judge's vestigial `selected` form field and its dead hidden
  input (the form submits via fetch, not native POST).
- Approval is now server-authoritative: the backend strips staff-owned
  fields from self-service submits (backend PR pairs with this).

The isSelected React state used for UI gating (QR cards, feedback CTA)
is a separate variable and is untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontend-ohack-dev Ready Ready Preview Aug 21, 2026 4:28am

Request Review

@gregv
gregv merged commit 1ee5066 into develop Aug 21, 2026
3 checks passed
@gregv
gregv deleted the fix/application-forms-drop-isselected branch August 21, 2026 05:08
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