i am using the following tutorial https://firebase.google.com/docs/firestore/manage-data/delete-data to delete all the documents within a collection while offline.
The problem I have is that Tasks.await(batch.commit());
blocks and not return while offline. As I understand from here https://developers.google.com/android/reference/com/google/firebase/firestore/WriteBatch, WirteBatch operations should work offline.
1
votes
1 Answers
0
votes
When we say an operation "works offline" it may not mean what you think it means.
The results of a WriteBatch
performed offline will be immediately reflected in any listeners or get()
operations that you perform. So if you delete a document in a write batch and then try to read it later (while still offline) it will appear to be deleted.
However the Task
will not complete until the write batch has been propagated to the server.