question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Firestore] FR: keepSynced - control what gets in the offline cache

See original GitHub issue

What feature would you like to see?

Something similar to what the Realtime Database offers:

docRef.keepSynced(keepOnlyThisReferenceInLocalCache=true)

This should store ALL data that this document reference contains and remove ALL other data from the cache.

How would you use it?

It would be great to limit the amount of data Firestore syncs and control what gets synced (our users experience cache misses when they are offline, frequently). Our team organized the document model so that every user has its own root that we would like to keep in sync.

That way, one can use the Firestore database as an offline-first solution.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:7
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wilhuffcommented, Sep 10, 2018

I’m going to leave this open because we are intending to address this, but we’re not going to do the trivial API sugar that RTDB did so it’s going to be a while before this lands.

0reactions
ruofeilyucommented, Mar 21, 2022

Any updates on this? This feature make Firestore to be offline first database in some scenarios

Read more comments on GitHub >

github_iconTop Results From Across the Web

Access data offline | Firestore - Firebase
Cloud Firestore supports offline data persistence. This feature caches a copy of the Cloud Firestore data that your app is actively using, so...
Read more >
Firebase does not sync offline cache if the app is killed
According to firebase documentation. Transactions are not persisted across app restarts. Even with persistence enabled, transactions are not persisted ...
Read more >
Advanced offline caching techniques in Cloud Firestore
Firestore SDKs implement a caching system that helps to reduce latency, support offline querying and mutations, and reduce billed document ...
Read more >
Firestore clients: To cache, or not to cache? (or both?) - Medium
Here's your guide to getting the most out of this cache. ... more caching control, especially to enable a full offline-first experience for...
Read more >
Announcing Mobile Offline Support - The Firebase Blog
Announcing Mobile Offline Support. ... Today we're announcing a set of features for our iOS and Android SDKs that ... [ref keepSynced:YES];
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found