-
Notifications
You must be signed in to change notification settings - Fork 885
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
onAuthStateChanged hangs on startup at PersistenceManager.create step #8482
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @GaurangTandon, Could it be that those operations are throwing errors instead of hanging? Could you try catching any error and logging if one is encountered? Also, there's a pretty lengthy and informative thread about Firestore and persistence in Web Workers in #7364 that's worth reviewing. Thanks! |
Hi @DellaBitta I added more logging last week and got some updated logs today. Updated patch file: Inside
I read the linked issue, thanks for sharing. For Web Workers, I understand more than one website tab can be open at the same time. However, in Chrome extensions, at most one extension service worker is going to be running at a given time. |
Update: I don't think alternative 2 is possible. If |
Hi @GaurangTandon, Thanks so much for clarifying all of this. We're still working to try to reproduce the problem. In the meantime, could you add another log after the line that creates the IndexedDB request? It'd be helpful to know if that operation is returning:
Perhaps even log the request object as well. Also, I've noticed that the Auth code creates a listener for the
Thanks! |
Operating System
Windows
Environment (if applicable)
Chrome 128
Firebase SDK Version
10.11.0
Firebase SDK Product(s)
Auth
Project Tooling
MV3 Chrome extension service worker built using webpack
Detailed Problem Description
Problem
onAuthStateChanged()
hangs on extension service worker startup and then remains hanged until the extension service worker is restarted (either by restarting the browser or by manually reloading the extension). Note that we are using indexeddb persistence so we expect the Firebase instance to get logged in automatically whenever the service worker restarts.Logging details
We added logging into the underlying
@firebase/auth
package usingnpx patch-package
, and got the hang on this case:PS: Let us know if you need additional logging inside the Firebase Auth package, and what exactly. It can take us a few days to get the data.
Steps and code to reproduce issue
We have roughly the following setup:
Note that we are using the web-extension entrypoint into firebase/auth. Note that we initialize persistence after auth has enabled. I'm not sure if it should be the other way around, I couldn't find any official docs around it, or if that matters at all.
I have attached the patch file generated using patch-package.
@firebase+auth+1.7.1.patch
The text was updated successfully, but these errors were encountered: