-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Retry IndexedDB Failures #323
Comments
@nVitius I'm very interested in this. Also I'm heavily working on the complete rewrite for v2.0, done with the core lib, and now just started on the Firebase logic. So I want to integrate this in 2.0 as well. To get things started I think this will be required first:
Based on this it'll be easier to determine how/which part of the codebase to implement this in. If you could help out with the above code snippets, that would be great! -- |
The function that catches and throws the IDB error is SyncEngine.write. This is called by the internal Firestore function FirestoreClient.write. This function in turn is used to write changes from the public APIs for DocumentReference.set, DocumentReference.update, DocumentReference.Delete, and WriteBatch.commit. It doesn't have a unique error code, but it looks like all the other places that throw the same error code (
P.D.: I really appreciate how actively you support this project. I just saw your post about the v2; it's very exciting. If by any chance you happen to need any help with work on the new version, let me know. I would love to collaborate on it. Even just to talk about the experience I've had using easy-firestore over the past year, if you think that would be valuable. |
@nVitius thanks for this. Based on your guidance I'll be able to implement this right away into v2.0. By the way i'm almost ready for beta launch for v2.0, at which point I'll definitely reach out! Can I request your help for v1.0? How I imagine this would be, at this line: vuex-easy-firestore/src/module/actions.ts Line 235 in 63e2aa6
you check for Make sure only to retry once and if it succeeds the second time, resolve. You can fork, |
Yeah, I can work on that. Will probably be ready for review in the next couple of days. |
@nVitius Cool, thank you so much! |
The Firestore SDK recently received an update (firebase/firebase-js-sdk#2938) that allows it to recover from certain IndexedDB failures. Previously, this would cause the SDK to crash and would require a page refresh.
The current behavior of the syncStack in easy-firestore is to catch errors from
batch.commit
. I think it would be a good idea to implement some retry logic (with back-off?) for the IndexedDB errors, as these are potentially sane commits that errored out due to external factors.I wanted to open up an issue and discuss the potential approaches. I am able to work on this if nobody more familiar with the codebase is able to.
The text was updated successfully, but these errors were encountered: