10

I am experiencing a strange behavior with my Firestore account, on the console I select a collection then I click Delete all documents an it indicates that all have been deleted successfully. When I refresh the data, the collection appear with all the deleted data. I have no service doing this anywhere and wondering what may cause this. Is there a solution?

Alongside this, any change I do to the document fields on the console are successful but are lost after refreshing.

Geek Guy
  • 710
  • 1
  • 8
  • 28

4 Answers4

5

I experienced similar behaviour today that I haven't seen before. I deleted documents from the Firestore console but my app was still fetching them successfully. Now, about an hour after witnessing that behaviour everything is back to normal and my console deletes are immediately seen on the device.

I'm thinking it was a glitch in Firestore - after all it's still in Beta.

mp501
  • 666
  • 8
  • 12
  • It' frustrating though, still looking forward to see response from their tech team since mine is not yet solved. Please remember to up-vote the question. – Geek Guy Feb 11 '18 at 20:25
  • YEAH, it worked when I accessed while browser is in incognito mode, they should consider the issue and if something is not documented then they should – Geek Guy Nov 27 '18 at 18:44
2

I tried all possible means, I had to back up the whole Firestore DB in Json files then deleted the project from console and created a new one. I think It's an issue with Firestore since I created the project before the launch of Firestore and may have required to create a new one.

Geek Guy
  • 710
  • 1
  • 8
  • 28
0

This happened to me today (7/1/18). After completely logging out of firebase and then logging back in, I was able to delete documents and have them be permanently removed.

DMayes
  • 41
  • 4
0

It happens because your app is using the cache memory instead of the actual data. You'll have to disable the cache and re-enable the network.

For iOS:

// disable cache
let settings = FirestoreSettings()
settings.isPersistenceEnabled = false
let db = Firestore.firestore()
db.settings = settings

// call your queries inside this layer

Firestore.firestore().enableNetwork { (error) in
// Do online things

}

For Android/Java:

// disable cache
FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder()
    .setPersistenceEnabled(false)
    .build();
db.setFirestoreSettings(settings);

// enable network
db.enableNetwork()
    .addOnCompleteListener(new OnCompleteListener<Void>() {
        @Override
        public void onComplete(@NonNull Task<Void> task) {
            // Do online things
            // ...
        }
    });

You can read more at https://firebase.google.com/docs/firestore/manage-data/enable-offline