firebase / firebase-js-sdk

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

Unable to process request due to missing initial state, but works on a retry #8629

Open dirk-nicolab opened 1 hour ago

dirk-nicolab commented 1 hour ago

Operating System

iOS 16.x and up, Android 12 and up, any browser

Environment (if applicable)

React 17.0.1

Firebase SDK Version

10.6.0

Firebase SDK Product(s)

Auth

Project Tooling

React web app.

Detailed Problem Description

Every now and then we are met with the error: "Unable to process request due to missing initial state" whilst trying to log in using Firebase. The problem is usually resolved when the user tries to login a second time.

I see a lot of similar tickets which are all dismissed for not running the helper code on the same origin as the actual application.

I can confirm both our Firebase helper code and application run on the same origin, so this is not the problem.

It appears to be some sort of race condition in the Firebase SDK client code.

image-20241029-151322

Steps and code to reproduce issue

The problem is very hard to reproduce because it seems to happen only sporadically. Nevertheless we receive a lot of complaints from our users. Some info that might help:

Like I said it appears to be a race condition which makes it very hard to accurately reproduce. I'll keep retrying to see if there are any specific steps that may help to trigger it more often.

google-oss-bot commented 1 hour ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.