Open jkrouz opened 5 years ago
Currently, there are no settings in GeoFirestore to prevent or force cache reads
Hi @Supercaly - i've asked a related Q on Stackoverflow: https://stackoverflow.com/questions/58677916/firestore-returning-deleted-documents-in-queries
The library is having inconsistencies with cache reads - specifically:
Reading from cache even though persistence has been disabled
Saying documents are from cache even though they are not
Is there any solution around this?
Hi @Supercaly. I'm giving a try to this library. I did notice that onDocumentEntered callback is still retrieving docs even thou they are removed when you requery. While the listener is active, however, onDocumentExited is only called. Common scenario of this issue is the following: you query a particular area then you requery another area with 0 docs then you delete yours docs of the old area then you requery the old area and both OnDocumentEntered and OnDocumentExited are fired with the old docs which they no longer exist in db but apparently they persist in cache. Please fixing this would be so much nicer. Thank you.
Hi @Supercaly - i've asked a related Q on Stackoverflow: https://stackoverflow.com/questions/58677916/firestore-returning-deleted-documents-in-queries
The library is having inconsistencies with cache reads - specifically:
- Reading from cache even though persistence has been disabled
- Saying documents are from cache even though they are not
Is there any solution around this? @jkrouz
This specific sequence will work for latest version of this library(v1.5.0). Give it a try. Put this on the onCreate() method or any other init method.
firestore = FirebaseFirestore.getInstance();
firestoreSettings = new FirebaseFirestoreSettings.Builder().setPersistenceEnabled(false).build();
firestore.setFirestoreSettings(firestoreSettings);
geoFirestore = new GeoFirestore(firestore.collection("name"));
My Firestore is still retrieving documents from cache even though I've explicitly told it not to.
At the moment
GeoFirestore
is the only code retrieving documents from cache. Examples from myGeoFire
onDocumentEntered
callback below:See the logs below:
DocumentSnapshot{key=instances/mQhRbBHCiKEB, metadata=SnapshotMetadata{hasPendingWrites=true, isFromCache=true}
DocumentSnapshot{key=instances/d6MsxlZWfgk3, metadata=SnapshotMetadata{hasPendingWrites=false, isFromCache=true}, doc=Document{key=instances/d6MsxlZWfgk3}
Is there something in GeoFire's code that forces Cache reads?
PS: I've posted a Stack Overflow question regarding this issue here