Repository navigation
Conversation
Signing up with Google calls finishSignupV2 with only a requested role, and the function passed the profile fields it wasn't sent (fullName, email, notificationFrequency, public) on to setRole as undefined. Firestore refuses undefined values, so the profile write threw after the role claim was set: the reader saw "Something went wrong!" and was left signed in with a role and no profile, which nothing afterward creates. In production every Google sign-up since Nov 1 failed this way. finishSignupV2 now writes only the fields a sign-up sent, through signupProfile. Email sign-ups send all of them, so they write what they did before. Also: Firebase's auth/too-many-requests, which it gives for repeated sign-in attempts or verification emails sent too close together, now reads as a message instead of "Something went wrong!". Verified: jest for signupProfile, including a Google sign-up's data; the old and new writes against firebase-admin's own validation, where the old one fails with the production error (undefined in field "public") and the new one passes; yarn test, yarn test:website, check-types (site and functions), check-formatting, and eslint on the changed file. Not verified: a Google sign-up end to end on the emulators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mvictor55
requested review from
Mephistic,
alexjball,
kiminkim724,
mertbagt,
nesanders,
sashamaryl and
timblais
as code owners
November 20, 2026 22:29
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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
Signing up with Google has been failing in production. A Google sign-up calls
finishSignupV2with only a requested role, and the function passed the profile fields it wasn't sent on tosetRoleasundefined. Firestore refusesundefined, so the profile write threw after the role claim was already set. The reader saw "Something went wrong!" and was left signed in with a role but no profile: Edit Profile renders blank, they can't add legislators, and anything they submit is published as "Anonymous". Every Google sign-up in production since Nov 1 (six accounts) failed this way; email sign-ups were not affected.finishSignupV2now writes only the fields a sign-up sent, through a smallsignupProfilehelper with unit tests. Email sign-ups send all of them, so they write exactly what they did before.auth/too-many-requests(repeated sign-in attempts, or verification emails sent too close together) now shows a readable message instead of "Something went wrong!".Checklist
errorMessagesmap incomponents/auth/hooks.ts.)firestore.indexes.json. (None added.)Screenshots
None: no visual change.
Known issues
finishSignupV2when the token has no role, so a sign-up that fails after the role claim is set for any other reason would still leave an account with no profile. Worth a follow-up so a signed-in reader without a profile gets one.auth/unauthorized-continue-urifallback insendVerificationshould have resent those emails without the return link, but it didn't rescue them, and why isn't confirmed yet. A follow-up could serve the site on one host, or build the return link on an authorized domain, so the fallback isn't needed in production.undefinedin field "public"), the new one passes.Extra Deploy Steps
profiles/{uid}documents for the six affected accounts, with each account's Google display name and email,role: "user",public: trueandnotificationFrequency: "Weekly"(the digest trigger then setnextDigestAt). None of them had testimony or drafts. Nothing to run after this deploys.Steps to test/reproduce
yarn --cwd functions jest src/profile/signupProfile.test.ts.profiles/{uid}hasfullName,email,role: "user",public: true,notificationFrequency: "Weekly"andnextDigestAt.