Skip to content

Multiple concurrent token refresh calls on app launch #15474

@thibaudse

Description

@thibaudse

Description

Hello Firebase team,

We’re encountering an issue where the Firebase SDK triggers multiple concurrent token refresh calls on app launch.

Summary

We’re encountering an issue where the Firebase SDK triggers 11 concurrent calls to the token refresh endpoint on app launch. This appears to be related to the 11 concurrent Firebase SDK calls we make during initialization.

We suspect a race condition or concurrency issue within the Firebase SDK where multiple requests try to refresh the same token simultaneously when it’s invalid or expired.

Expected Behavior

The SDK should detect that a token refresh is already in progress and queue or await the same refresh promise instead of triggering multiple concurrent calls.

Actual Behavior

  • Multiple simultaneous refresh token requests are triggered.
  • This causes:
    • Quota exhaustion on the Firebase token refresh endpoint.
    • Some users being signed out unexpectedly, likely due to tokens being replaced or mismatched during concurrent refreshes.
  • We’ve observed this affecting ~15% of our users today (millions of MAUs).

Evidence

We’ve attached a Proxyman screenshot showing 11 concurrent refresh calls happening within the same timestamp window.

Image

Impact

  • User sign-outs and degraded session stability.
  • Increased API quota consumption.
  • Difficult to reliably reproduce or intercept due to concurrency nature.

Reproducing the issue

It’s difficult to reproduce consistently, but the general flow is:

  1. Initialize Firebase SDK on app launch.
  2. Make several concurrent calls to Firebase (Firestore, Auth, etc.).
  3. If the user’s token is invalid, each call triggers a token refresh.
  4. The SDK fires multiple concurrent refresh token requests instead of handling the refresh synchronously.

Firebase SDK Version

12.3.0

Xcode Version

26.1

Installation Method

Swift Package Manager

Firebase Product(s)

Authentication

Targeted Platforms

iOS

Relevant Log Output

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions