Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Firestore reset cache

At the moment I have document snapshots that are coming from my phone's cache. I know this from

print(document.metadata.isFromCache ? "NOT FROM NETWORK" : "FROM NETWORK");// document is a DocumentSnapshot

flutter: NOT FROM NETWORK

However I have deleted some of these documents off firestore, but they are still appearing. I would like to know if there is a way in which I can reset my cache for firestore in flutter so that all the documents are from the cloud.

Thanks for any help - much appreciated.

like image 924
GILO Avatar asked Jan 13 '20 20:01

GILO


1 Answers

It sounds like a bug if a document shows up in a query where the source document has been deleted, if the app has connectivity and can synchronize with Firestore. If you can reproduce this situation with specific steps, the Firestore team might want your bug report.

If you just want to start with a clean cache for development, you can uninstall and reinstall the app to clear the cache.

On Android, there is a system option where you can clear app data (there might be a similar iOS option as well).

like image 172
Doug Stevenson Avatar answered Oct 01 '22 15:10

Doug Stevenson