-
Notifications
You must be signed in to change notification settings - Fork 938
Promises returned by doc().get() sometimes stop getting resolved if persistence is enabled #3120
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
Comments
Hi @optimistiks, thanks for taking the time to compile the logs and code samples together. These were super helpful to understand your situation. I used the the link you sent me, rapidly clicked the button a few separate times on different machines and browsers and so far I haven't hit the issue you described.
|
Hi @rafikhan ,
We have several reports from our users, but it seems like due to the nature of the issue, some users are completely unaffected. It reproduces during development as well, both when using the full emulator suite, and when connecting to the actual Firebase project.
We've just run some more tests with my colleague. We were able to reproduce the issue on our staging and production builds in the following browsers:
We were not able to reproduce it in Chrome. In my first message I said we could, but it was some misunderstanding. Seems like this issue is Safari-only.
We do have this flag set to |
@optimistiks Thanks for reporting this and for responding to @rafikhan's questions. I will take a look at this, but will probably not be able to get back to you until Monday or Tuesday. |
@optimistiks How often do you need to press the button to reproduce? I am testing on Desktop Safari 13.1 and everything works for me. We have issues in the past when multiple hundreds of queries are pending. I wonder if this might be the problem you are hitting. |
I am seeing this problem as well. My environment:
my code is fairly simply -
Eventually the code hangs on the The behaviour seems to only occur when you havee the
I have not seen this occur when I remove Can you please advise? I will try and get an easier recreate however you have one above from @optimistiks - are you able to try this on a mobile device? This bug is a bit of huge blocker for me - i have unfortunately had data loss for a client due to not awaiting the result of the save operation. :( |
@wallaceturner Do you use onAuthStateChanged before it? I have pretty similar situation if I do it.
|
@zemfr all my queries are done after |
I just tried to reproduce without onAuthStateChanged, only with firestore query and I also get this bug. I use the same scenario that I described. But I noticed that I can't reproduce it, if I remove firebase-auth script from the page |
@wallaceturner / @zemfr Firebase Auth is also using IndexedDb by default. I wonder if the SDKs are stepping on each other toes here. @avolkovi Have there been reports that the Auth SDK ends up blocking IndexedDB access? |
@schmidt-sebastian what useful information could i provide? i could give you the stack possibly where it is blocked |
@wallaceturner I cannot promise that just looking at the stack will help, but I would love to see it. FWIW, we are currently rewriting the Auth client from scratch. I suspect you can work around this issue in the meantime by disabling IndexedDB access in Firebase Auth. I have to admit that I don't know how to do this though. |
Thanks, I will give it a shot - you probably have more idea than given I didnt even know it used IndexedDb - any pointers would be appreciated. How do you know its even possible to simply switch storage mechanism ? |
I am moving this issue over to Firebase Auth to see if there is a chance for a short term mitigation. |
I'm experiencing a similar problem where This is problematic when data needs to be written immediately after a user signs up. I've gotten reports from two other users of the React/Firebase template that I sell that they are also seeing this issue. Thought I'd mention it here since it seems like it could be related. Let me know if I should start a new issue for this. |
Happening for me consistently. Using nuxt-firebase. |
I am experiencing exactly the same issue as @gragland in my own project—that follow on In my case, persistence is not enabled, but we'd like to at some point in the future. I am integrating Firebase with Vue and Vuex, with Firebase generally being called from within Vuex actions. Also similar to @gragland, I am happy to raise a separate issue or provide more data if needed. |
@nefarioustim @gragland would be good if you start a separate issue |
Have also experienced this issue for a while, I don't think the issue is new. Implemented a workaround that reloads the app when this happend, but it is not a workable solution. Please prioritize this issue. I was able to reproduce the issue by doing alot of writes on the backend on multiple collections with active listeners in the client. After that sets and gets no longer respond. Primarily an issue with Safari, iOS capacitor app. |
Checking in to see if PR 4971 fixed this issue for folks. Thanks! |
Hey @optimistiks. 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! |
Since there haven't been any recent updates here, I am going to close this issue. @optimistiks if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
Uh oh!
There was an error while loading. Please reload this page.
Describe your environment
Describe the problem
In our app, we've discovered that sometimes when you request documents from a collection in quick succession, the documents just stop loading. The promises returned by SDK (
doc(id).get()
) just stop getting resolved,then
callback never fires, and neither doescatch
.Steps to reproduce:
It is a very hard to replicate issue.
We've discovered that the issue happens only with enabled persistence. So we've created a codesandbox to reproduce.
https://xqwkf.csb.app
You will see a button. This button loads a document from a collection, using a random id. Normally, when you click it once, you will see 2 logs in the console - START, meaning request is started, and FINISH, meaning promise is resolved, and the document is retrieved.
However, if you click this button fast enough, the promises stop getting resolved. You will only see START logs, and no FINISH logs.
It replicates only sometimes. We couldn't pin point the exact 100% steps to reproduce. So I'm attaching a gist where you see the logs from the console (Firestore debug logs included) from one of the successful attempts. You can search for "POI:" in that gist to find the place when it stopped working. Gist: https://gist.github.com/optimistiks/6176952eff312fba981c0c8d90254639
Relevant Code:
https://codesandbox.io/s/busy-mendel-xqwkf. The code for the above example. Note that it won't work in the codesandbox preview, you need to open it in a separate tab using this link https://xqwkf.csb.app.
The text was updated successfully, but these errors were encountered: