vuex-easy-firestore icon indicating copy to clipboard operation
vuex-easy-firestore copied to clipboard

Vuex not in sync if same doc is inserted and deleted in same batch call

Open jacksonrya opened this issue 6 years ago • 3 comments

If a document is created locally and then immediately deleted, in a short enough time that the two calls become batched, the document is deleted locally but still exists in Firestore.

jacksonrya avatar Nov 12 '19 21:11 jacksonrya

@jacksonrya Good catch!! 😉 I'd like to know a little bit more about your use case. Can you let me know, in what kind of situation in your app a document would get created and deleted again in under 1 second?

Thanks!!

--
Vuex Easy Firestore was made with ♥ by Luca Ban.
If this library helped you in any way you can support me by buying me a cup of coffee. ☕️
You can also reach out on twitter if you want a one-on-one coding review/lesson. 🦜

mesqueeb avatar Nov 13 '19 01:11 mesqueeb

Apart from the user's use case, is this an issue in the way v-e-f queues its requests, or is Firebase that ignores the delete request?

louisameline avatar Dec 05 '19 20:12 louisameline

@louisameline this is an issue in my implementation. I know I can fix this if I want. I was just hoping on more context so I have better insight in how I can fix it. :D

VEF not only batches all changes within 1000ms, it also groups changes made to the same documents, therefore a deletion and update request conflict.

I think on firebase side it will also provide an error if you submit a batch with an update and delete request on the same document, because batches have no specific order.

mesqueeb avatar Dec 12 '19 07:12 mesqueeb