Skip to content
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

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

Open
filipesilva opened this issue Apr 4, 2021 · 3 comments
Open

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

filipesilva opened this issue Apr 4, 2021 · 3 comments

Comments

@filipesilva
Copy link

[REQUIRED] Describe your environment

  • Operating System version: macOS Big Sur
  • Browser version: Chrome 89, Safari 14.0.3
  • Firebase SDK version: 8.2.7
  • Firebase Product: Auth

[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:

  • Log in to a firebase app in chrome that isn't getting any updates from RTDB or Firestore
  • Start the CPU profiler in devtools
  • Leave the tab in the background and stop the profiler after a few minutes
  • You should see something like this:
    image
  • Most of these spikes are attributed to firebase auth
    image
  • Login to the same firebase app in safari
  • Open the devtools, and record a timeline that includes cpu usage
  • It should look like this
    image

Relevant Code:

Any logged in firebase session.

@sam-gc
Copy link
Contributor

sam-gc commented Apr 12, 2021

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
Copy link
Contributor

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants