-
Notifications
You must be signed in to change notification settings - Fork 884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth persistence sometimes clears the user #5874
Comments
Hi @hatboysam, thanks for your report. We'll try to investigate this and see what we can find. |
Hi @hatboysam, is there any network call before this happens (i.e. does the token try to get refreshed and the call fails? that's one reason the SDK might log the user out)? Have you noticed any particular pattern to the issue or is it random? |
@sam-gc yes in one report there is a network request to this endpoint 30 seconds before the
In another report I see this request, also exactly 30 seconds before the
So it seems like the Auth SDK is making some request, timing out after 30 seconds, and then signing out. However I don't believe this is a simple "user offline" issue for two reasons:
Here's a sample of the timeline: So while other requests are succeeding, Auth requests are failing / timing out. So ... is there some other kind of logging I could add to help debug this? Maybe you have some backend logs you could look into to see if there are latency spikes in the Firebase Auth / GCIP backend lately? |
The linked PR should fix the issue. Separately, it's odd that the request is timing out. Regardless this should still fix the issue and restore the expected v8 functionality |
@sam-gc nice thank you! |
[REQUIRED] Describe your environment
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:95.0) Gecko/20100101 Firefox/95.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:95.0) Gecko/20100101 Firefox/95.0
[REQUIRED] Describe the problem
Steps to reproduce:
Users have been reporting to me that they are being signed out of my website after a few days. This has only started happening since I updated my app from Firebase v8 to the v9 modular SDK. My app only uses Custom Authentication.
I initialize Auth as follows:
In my main app initialization code I attach a global Auth listener:
Sometimes I seem to get
onAuthStateChanged
called with anull
user even after the user has been signed in for days. For my own app logic I also store my own user state in LocalStorage and this state persists infinitely, whereas Firebase seems to clear sometimes.So I get errors from the following situation:
user === null
The text was updated successfully, but these errors were encountered: