firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.85k stars 892 forks source link

Firebase Auth keeps browser tabs active while in the background #4724

Open filipesilva opened 3 years ago

filipesilva commented 3 years ago

[REQUIRED] Describe your environment

[REQUIRED] Describe the problem

Firebase auth wakes up a background tab every 10s or so even when there's no activity in the firebase tab (e.g. via realtime database or firestore). This shows up in Safari as having a constant power usage and prevents low-power states for that tab.

I imagine this is due to refreshing auth tokens, but it would be nice to bring the power usage and tab wake ups down to 0 if indeed there's no activity happening.

Steps to reproduce:

Relevant Code:

Any logged in firebase session.

sam-gc commented 3 years ago

Hi, thanks for reaching out. I'm unable to reproduce this in a simple app using Firebase Auth / Firestore. Can you share a bit more detail about your app you're seeing this in? What frameworks are you using, etc?

google-oss-bot commented 3 years ago

Hey @filipesilva. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

filipesilva commented 3 years ago

Hi @samhorlbeck! I'm using Firebase Auth on a browser app with Realtime Database, Storage, and Cloud Functions (which I imagine should't make a difference because because cloud fns are in the backend).

I also use two firebase apps where the only difference is the app name. I use the second one to write to RTDB without getting optimistic updates, because that doesn't match our app semantics.