fix: surface real API errors on registration form - #3
Open
nicholas-ruest wants to merge 1 commit into
Open
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"No solo spots remaining"HTTP 409 from the Cloud Function). Users couldn't tell the form was actually calling the backend.Register.tsxnow parses theApiErrorJSON body and shows the server's error message in the toast, falling back to the generic message only if parsing fails.scripts/seed-inventory.shpreviously wrotesingleRemaining, but the deployed Cloud Function readssoloRemaining. 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 typecheckpasses (already verified locally)npm run buildsucceeds🤖 Generated with Claude Code