Reputation: 125
When the device is offline, the app stores any Firestore changes locally and update them when the internet connection is back. Is there a way to check in the app if the local changes finished uploading Firestore?
Upvotes: 1
Views: 1034
Reputation: 599041
There's no API to get a list of the pending writes, nor is there a flag that signals whether there are pending writes. But there are a few things you can do:
For a specific write, you can attach a completion listener to detect when it has completed. When the Future
that the write resolves, the write has been committed on the server.
When you're getting a DocumentSnapshot
, you can check the hasPendingWrites
property in its metadata to see whether the snapshot has pending changes.
Upvotes: 2