Description
Operating System
Primarily observed on iOS devices in production (Ionic 5 + Capacitor 6 + React 17)
Environment (if applicable)
Mobile: iOS (sporadic, seen in logs and user reports) and Framework: Ionic 5, Capacitor 6, React 17
Firebase SDK Version
8.10.1
Firebase SDK Product(s)
Auth
Project Tooling
Ionic 5, Capacitor 6, React 17
Detailed Problem Description
Some users mainly on iOS as currently seen in our logs get stuck on the loading screen when opening the app.
• The onIdTokenChanged
and onAuthStateChanged
callbacks never fire (no logs output).
• Wrapping setPersistence(Auth.Persistence.LOCAL)
with .then
/.catch
logs shows neither handler runs—the Promise remains pending.
• firebase.auth().currentUser
is logged right before the listener is attached, confirming the code path is reached.
• This appears related to IndexedDB, which setPersistence(LOCAL)
relies on. If IndexedDB open hangs (possibly more likely on iOS), the Promise never resolves and authentication events do not fire.
Example code:this.firebaseAuth
.setPersistence(Auth.Persistence.LOCAL)
.then(() => console.log('[Auth] persistence set')) // never prints
.catch(err => console.error('[Auth] persistence error', err)); // never prints
Reproducibility:
• Sporadic in production, mainly on iOS; not yet reproduced internally
Steps and code to reproduce issue
- Use Firebase JS SDK 8.10.1 in an Ionic 5 + Capacitor 6 + React 17 app.
- Call
setPersistence(Auth.Persistence.LOCAL)
before setting up auth listeners. - For some iOS users, the Promise never resolves or rejects, and callbacks for
onIdTokenChanged
/onAuthStateChanged
never fire. - No error is logged, and the app remains stuck on the loading screen.