-
Notifications
You must be signed in to change notification settings - Fork 893
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
auth.onAuthStateChanged + firestore.onSnapshot cause infinite loop of calls to /token. #3222
Comments
onAuthStateChanged
+ firestore.DocumentReference.onSnapshot
cause infinite loop of calls to /token
.
Interesting.. I'm not sure but I suspect this is more related to the Firestore SDK than Auth directly. I'm rerouting this to Firestore. |
Thanks for reporting the issue. I will try to reproduce it and will post an update when I have one. |
same here |
I'm really sorry, but I had no luck trying to reproduce this so far. I'm using a Windows 10 laptop and Chrome. The only significant change I made to the repro case is to change the project configuration. Can you please clarify a few things? (I have added numbers to the reproduction steps in your original message to make it easier to refer to them, I hope you don't mind)
Finally, could you please enable debug logging, reproduce the issue and share the resulting logs? (please omit any sensitive information) |
This is likely caused by #3184 (... but that was only released with v7.15.1). |
@notVitaliy Can you confirm that this indeed already broke with v7.10? Thank you. |
Yep, I was able to re-create the issue starting with 7.10. @var-const I'll get back to you on those questions sometime tomorrow. |
I have had this issue for a while now, but have ignored it as I didn't know how to fix it. Strangely, it only appears to happen on Windows for me. Linux does not have the issue. |
I have the same problem, auth is looping https://securetoken.googleapis.com/v1/token?key=... |
@Xstyler85 What version of Firestore are you using? |
@schmidt-sebastian I'm using "@firebase/app": "^0.6.6" I will try to update. |
The latest version of Firestore has a number of changes that should improve our authentication state handling. Please let us know if you can reproduce using a newer version. |
@schmidt-sebastian upgrading on version "0.6.8" solved all problems for me. |
Closing as there are no active reports. If more reports surface, we may want to merge #3260 |
@schmidt-sebastian I'm very sorry, but I was looking at the "JS" filter instead of the "XHR" filter by mistake. |
@Xstyler85 Can you clarify what Line 906 of |
We're facing the same issue in our app, we use |
Forgot to mention, perhaps very important for a possible fix, is that we use |
@Redmega Do you not use |
Not at all. This is solely with the |
If it helps I can confirm all the rest of the details are the same -- It seems to only affect some Windows users, regardless of browser. It also interferes with sign in's, though this might be a result of googleapis and not the sdk -- the user is kicked back to the login page after the id token errors out (due to application logic when missing an authed user), and when they attempt to login the call to |
Have the same issue with infinite loop of get token requests after google sign in (signInWithPopup). Windows 10, firebase/app 0.6.10. https://github.com/s-pyadyshev/sdsh-react-mobx |
cc @avolkovi Adding Alex, since this seems to no longer be Firestore specific. Note that there might not be much we can do here, but the good news is that we are rewriting Firebase Auth from scratch. |
This issue is still happening for me on Windows. Thank you for looking more into this. |
@lymeo I am experiencing exactly this on mac + chrome. |
Got the same issue on linux, it went away after correcting my system timezone setting which was incorrect. |
I think you may be onto something. It's never happened for me on Linux, but I know Windows and Linux store dates differently. So this could be part of the issue. |
iMac - Catalina 10.15.7
MacBookPro - Catalina 10.15.7
Is there any update? |
Similar to your problem. I have a NextJs app. |
Fixed time zone in my iMac everything back to normality now. |
Same, on windows only with @firebase 7.22.0 has this problem but 7.9.3 works fine. |
I have a dual boot with debian next to windows and the date on my windows was incorrect, it was fixed after i set the correct date and time. Maybe it can help you to solve this issue. |
Are we sure that this is a potential fix? |
Ok confirmed with our customer: it was a clock skew issue on their end 🤦♂️ |
Another reproduction: Instructions:
If you press log out, you will no longer see those requests. This issue should be fixed and handled in the SDK. Otherwise, any person with harmful intentions can just use this exploit to cause high bills. |
Are you kidding me??!!! It was the timezone?!?!? Just did a new Windows install (not for this issue) and ran into this issue not realizing my timezone was wrong (Thank you Microsoft for defaulting to Pacific Time.....Windows tries to enable every other configuration, but stopped at "Set time zone automatically", really!!!???? someone please buy me a Chromebook!!!). Spent all day troubleshooting trying to figure out why it was working on some machines and not others. FWIW, my issue occurred when a user is authenticated and I run firebase.firestore() and it doesn't have to be in that order. Also, I narrowed it down to starting in 7.11 and I don't have the issue in 7.10. Thought it might be related to the "Added multi-factor authentication support for Google Cloud Identity Platform projects." feature added in 7.11 Even built a nice test site here: https://apaggello.web.app/ The looping URL for anyone searching this is Please fix it for the sanity of the next person that might run into this, thank you!!!! |
#4210 solved this problem(released on v8.2.1), I can't reproduce the problem anymore. I guess this issue can be closed after some time and feedback from other people just in case. |
Sorry for the late reply, but yes, this fixed the problem for me. I spent more than half a day to understand why in my laptop I didn't have the issue while on pc I did. |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Calls to
onAuthStateChanged
andonIdTokenChanged
send off a flurry of requests tosecuretoken.googleapis.com/v1/token
until it responds withQUOTA_EXCEEDED
. This only happens when the user is authenticated.Steps to reproduce:
This error does not occur on Linux or macOS. I was not able to replicate it in a windows VM on Linux. It's only on windows in both firefox and chrome. However, I've only had success replicating with 2 windows machines and failed to replicate on another windows laptop.
https://stackblitz.com/edit/firebase-issue-sandbox-vzdnt7
This is the strangest bug that I've run across and it took quite a bit to isolate the exact sequence of events that was causing it.
My initial thoughts are that calls to the firestore document snapshot are causing the
onAuthStateChanged
observer to trigger.edit: I just did some more digging and this bug does not happen in 7.9.3 but does in 7.10.0
The text was updated successfully, but these errors were encountered: