-
Notifications
You must be signed in to change notification settings - Fork 928
Recovering from IndexedDBTransactionError #2997
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
I found a few problems with this issue:
|
I was wondering the same thing |
@nVitius / @mesqueeb We are mostly trying to retry on the users behalf. We will do this for all IndexedDB errors that are not result of direct user input - e.g. periodic events, network traffic, syncs from multi-tab. For the two event sources that are under the users control (new writes and new onSnapshot() listeners), we will bubble up the IndexedDB error. This allows our SDK to provide the same guarantees as before without blocking our internal queue. It also gives the user the opportunity to minimize these kinds of errors, e.g. to not issue new writes to Firestore when the app is in the background. For now, and until #2755 is closed, there will still be IndexedDB errors that crash the AsyncQueue. I am working on addressing all remaining areas. When #2755 is closed, you will no longer need to reload but you might need to re-issue writes and re-register listeners that failed with IndexedDB errors (this change is coming in #2944). I will file a bug to update the documentation. Thanks for pointing that out. |
Filed b/155351358 |
@schmidt-sebastian Thanks for the reply. Just wanted to point out that the issue you mentioned, #2755 has been closed for several weeks now. What is the best way for us to continue to track the progress of this as more relevant PRs are merged in? |
@schmidt-sebastian I wanted to ask a couple of questions about the fix (#2938) that you implemented for the Offline IDB issues that we have been seeing.
First off, thank you for your work on this issue. I know that it hasn't been a simple one to address.
If I remember correctly, the error that IDB would throw on these errors was something along the lines of "transaction can not be completed, database connection already closed".
Looking at the code, it doesn't seem that there is actually anything implemented yet to try to re-open the IDB connection once it becomes available again ref
Are we still expected to refresh the page when these errors occur? If so, are there plans to add code to re-establish the connection?
Either way, the fact that we can finally catch the error is a definitely something we can work with.
P.D. I think it would be a good idea to reference this issue in the Firebase documentation. https://firebase.google.com/docs/firestore/manage-data/enable-offline
For users unaware of the issue, it would result in data loss for their applications.
The text was updated successfully, but these errors were encountered: