0

I have an issue where in past versions of my application I've called keepSynced(true) on many children of a collection. For example, say I have a collection posts with children post/1, post/2, post/3, etc. The children refs have been marked as keepSynced true individually when created, but I'd now like to remove all old posts from the local cache.

Can I simply call keepSynced(false) on posts or do I need to query all of the children and call that for each child ref? Assume there is a long history of posts so querying all of them might be expensive.

One thing that would also help me is being able to see the local cache file to inspect it's size, but I can't seem to find that in the app's data directory.

Patrick Goley
  • 5,397
  • 22
  • 42

1 Answers1

1

The status of keepSynced is not maintained between runs of the app. So if you just remove the calls, and run the app again, it will stop synchronizing those nodes.

To toggle the status of keepSynced in a single run of the app, you will need to call keepSynced(false) on the same nodes that you called keepSynced(true) on. While the data is read from child nodes, there is no inheritance of the attribute.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807