AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Request throttled11/23/2023 I will explain the console behavior I observed step-by-step: Tab 3 running v9.11.0 Step 1: A bunch of POST requests fail (could be while the computer is being put to sleep). The tabs running v9.11 did not get into an infinite loop, but did get into a LONG loop, showing hundreds of console warnings and network tab requests, including appcheck throttling and therefore Firestore errors which eventually rendered the app dysfunctional since it no longer could load data. The first tab kept showing "AppCheck: Requests throttled" warning, whereas the scond tab kept showing "AppCheck: ReCAPTCHA error" as you can see in the screenshots above. I.e., both tabs running v9.10 got stuck into an infinite loop eventually, but not on the same day, and the console & network tabs were not the same in both instances. Tab 2 with v9.10 - infinite loop after two days: v9.10 Tab 1 with v9.10 - infinite loop after one day: The tabs with v9.10 triggered an infinite loop, whereas the tabs with v9.11 didn't trigger an infinite loop (so I believe the infinite loop + high CPU usage issue is probably resolved), but the throttling introduced in a different related commit might have triggered a different side-effect. Two tabs with v9.10 and two tabs with v9.11, and left them open a couple of days. I updated to Firebase v9.11.0 three days ago and opened 4 tabs to test: I hope this helps and let me know if there's anything else I can provide, this bug is blocking my app from going into production so I'm happy to help fix first of all I want to say thank you very much for taking this issue seriously and for your perseverance in finding a fix. I also have LogRocket set up and it probably has recorded the infinite loop happening, but I assume sharing more console logs is probably not as helpful as getting a working repro. My app sets everything up almost identically to your test app, so I think if you add the sign-in you might be able to repro what I'm seeing. I don't have the time to try it myself but I think your test app should try signing in the user before attaching the snapshot listener (i.e after your onTokenChanged call, add await signInWithEmailAndPassword(getAuth(), "password")) Could this indicate that there's some bug in the interaction between firestore and AppCheck (as opposed to being an AppCheck only bug)? In my app, the only meaningful difference between the signed-in and signed-out states are that I only attach snapshot listeners when the user is signed in. I noticed that I consistently got the infinite loop when waking the computer from sleep overnight on the signed in tabs, but never on the tab that is signed out. I was testing my app while logged into multiple accounts at once, and had a number of tabs/incognito tabs open in Chrome/Firefox. I haven't had any of the write issues because my app doesn't write directly to firestore, but I did notice something that might help your repro: Hi, I've been running into this infinite loop problem as well. I think this is a pretty good foundation for a test app, if someone wants to take this code and build an app, and modify it as needed so that it reproduces the same kinds of errors you are seeing, and let me know what steps to take to reproduce it, that would be really helpful. Also, onSnapshot fired and logged the new value. When I pushed the "write" button again, however, it did a successful write, and I could see in the console that it propagated to the backend. Import and GET (default)&RID=rpc&SID=FAOPCVbx-faguJtrJYxdhQ&CI=0&AID=8&TYPE=xmlhttp&zx=e3rogsaw1mnv&t=1 400 So it seems like it already does what I proposed in the first place but it sometimes fails to update the Firestore in the cloud after waking up despite successful writes. I even managed to update documents in Firestore without having to refresh this time, which is. Then when it woke up it did the following:Ī successful POST and after it a successful POST. These happened when the computer was sleeping. with net::ERR_QUIC_PROTOCOL_ERROR 200 and net::ERR_NAME_NOT_RESOLVED. Multiple failed requests to POST with net::ERR_INTERNET_DISCONNECTED status. This is what I can see after leaving the computer sleeping overnight and waking it up the following morning. No, the problems started to occur after I enabled it. App Check is not enabled, you don't have any of these issues with Firestore?
0 Comments
Read More
Leave a Reply. |