Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi all looking for guidance on an intermittent Firebase Auth issue.

What’s happening

• Some users open the app and remain stuck on the loading screen.
onIdTokenChanged and onAuthStateChanged never fire (no logs).
• We wrapped setPersistence(Auth.Persistence.LOCAL) with .then/.catch logs—neither handler ever runs, indicating the Promise stays “pending”.
firebase.auth().currentUser is logged right before the listener is attached, so the code path is reached.

this.firebaseAuth
  .setPersistence(Auth.Persistence.LOCAL)
  .then(() => console.log('[Auth] persistence set'))      // never prints
  .catch(err => console.error('[Auth] persistence error', err)); // never prints

Why we suspect IndexedDB

setPersistence(LOCAL) relies on IndexedDB. If the database open hangs, the Promise never settles and no auth events fire.

Environment

Item Value
Firebase JS SDK 8.10.1
Framework Ionic 5 + Capacitor 6 (React 17)
Persistence requested Auth.Persistence.LOCAL
Reproducibility Sporadic in production; not yet reproduced internally

Questions

  1. Is a never-resolving setPersistence() Promise a known issue?
  2. Recommended ways to detect or recover from this state?
  3. Would upgrading to Firebase v9+ likely help?

Any insights or similar experiences would be greatly appreciated. Thank you!

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.