-
Notifications
You must be signed in to change notification settings - Fork 997
Open
Labels
Repro Neededapi: authneeds-attentionquestionstack:ReactReported issue example uses ReactReported issue example uses React
Description
Operating System
iOS (mostly)
Environment (if applicable)
mobile
Firebase SDK Version
12.7.0
Firebase SDK Product(s)
Auth
Project Tooling
React app Vite
Detailed Problem Description
- At my company we use firebase for authentication. We have around 100,000 distinct users that go through some sort of auth every week.
- We received some reports that our magic link flow was not working intermittently. Folks would click the link but instead of being signed in automatically as expected they would hit our login screen.
- After adding extensive logging we realized people encountering this issue were being signed in but immediately after their sign in we received an event from
onIdTokenChangedwith a null user. - Our logs indicated that this trigger of
onIdTokenChangedwith null user didn't originate from our own code. - Additionally logs indicate this trigger of
onIdTokenChangeddoesn't result from a window storage event (we're using BrowserLocalStorage persistence). - Digging into the firebase sdk code we noticed there's a fallback polling mechanism here.
- After disabling this fallback via a patch the problem of some users being signed out randomly stopped. Previously this was happening to around 700 folks every week.
- The polling fallback appears to be for old mobile browser we don't need to support.
- The intermittent problems here indicate that there is likely some sort of subtle and rare race condition in the polling code.
Steps and code to reproduce issue
Unfortunately we were unable to reproduce the issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Repro Neededapi: authneeds-attentionquestionstack:ReactReported issue example uses ReactReported issue example uses React