Skip to content

fix: surface real API errors on registration form - #3

Open
nicholas-ruest wants to merge 1 commit into
mainfrom
fix/registration-error-surfacing
Open

fix: surface real API errors on registration form#3
nicholas-ruest wants to merge 1 commit into
mainfrom
fix/registration-error-surfacing

Conversation

@nicholas-ruest

Copy link
Copy Markdown
Contributor

Summary

  • Registration form was showing a generic "Registration failed" toast on every error, masking the real reason (e.g. "No solo spots remaining" HTTP 409 from the Cloud Function). Users couldn't tell the form was actually calling the backend.
  • Register.tsx now parses the ApiError JSON body and shows the server's error message in the toast, falling back to the generic message only if parsing fails.
  • scripts/seed-inventory.sh previously wrote singleRemaining, but the deployed Cloud Function reads soloRemaining. The two had drifted into separate Firestore fields, leaving the function-readable counter at 0 and blocking all solo registrations. Script now writes the correct field.

Context

The underlying production issue (solo counter at 0, family counter at 1) was already fixed via direct Firestore writes — soloRemaining=10, familyRemaining=17 (reconciled against 3 paid family registrations vs. ADR-026's cap of 20). This PR is just the code-side hardening so the next time something goes wrong, the error is visible instead of hidden.

Test plan

  • npm run typecheck passes (already verified locally)
  • npm run build succeeds
  • After deploy, trigger a known-failing path (e.g. submit a tier that's sold out) and confirm the real server message appears in the toast
  • Confirm the happy path (valid solo/buddy/family submission) still redirects to Stripe Checkout

🤖 Generated with Claude Code

… name

Registration form was swallowing the Cloud Function error and showing a
generic "Registration failed" toast. When solo inventory hit 0, users (and
operators) couldn't tell the form was actually reaching the service.

- Register.tsx now parses ApiError and shows the server message
- seed-inventory.sh: singleRemaining -> soloRemaining (matches what the
  deployed Cloud Function actually reads)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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