Skip to main content

Signed out on every cold start after switching phones (Firebase SDK regression)

Users who set up Bullet on a new phone (restoring from a cross-device backup) are signed out every time the app cold-starts - e.g. whenever the OS kills the app after a few hours dormant. Especially visible on Samsung devices, which kill background apps aggressively.

Root cause: a known regression in the Firebase Auth Android SDK 23.2.1 (shipped in Bullet via Firebase BoM 33.x). That version added encryption to the persisted auth session, and fails on data restored from cross-device backup, signing the user out on cold start. See firebase-android-sdk #7111. Reinstalling doesn't help because Android auto-backup restores the affected data.

Fix: upgrade FlutterFire packages so the Android BoM is 34.1.0+ (firebase-auth 24.0.1 contains the fix), and exclude Firebase Auth prefs from Android auto-backup. Secondary hardening: a transient null from the auth stream currently also triggers clearLocalData() in the PowerSync initializer, which wipes local data - worth gating on authoritative sign-out.

1 comment

Log in to comment and vote

Comments1

  • Emerald Milkyway

    •

    Aug 4

    **Android app logging out after inactivity** App constantly logs out when dormant for a few hours. Started after switching to Galaxy S25 Ultra running One UI 8.5. Was not happening on previous device. Clearing data, cache, and reinstalling did not fix it. No automatic logout mechanism exists in the app code - Firebase userChanges() stream is the only thing that can trigger the login screen. Needs investigation into why Firebase auth state is being cleared on this device/OS combo.