frequent cache writes don't propagate to some observers
See original GitHub issuereproduction: https://codesandbox.io/s/apollo-client-frequent-cache-writes-lybjy (if empty wait 20 sec for backend to spin up)
The button calls writeFragment
twice in separate tasks. Cache looks good always. The issue is some observers don’t get notified if updates come in too fast.
This happens in my app where you get a couple of WS messages with minimal interval. Some components get called twice and therefore have up-to-date cache data, while others get called only once, and their data is stale. This happens with any write method (I tried writeQuery
, writeData
, writeFragment
). Also tried @apollo/client
beta, same result.
If there’s more <Box />
es, all but the last two update as expected.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Cache Consistency Options - Ehcache
Propagation of Modified Data In general, any data cached in the heap is always consistent in that heap. For example, if one thread...
Read more >LiveData prevent receive the last value when start observing
I don't think it is possible to prevent LiveData from receiving the last value when start observing if you are using them as...
Read more >objc-cache.mm - Apple Open Source
assertLocked(); // Never cache before +initialize is done if (!cls->isInitialized()) return; // Make sure the entry wasn't added to the cache by some...
Read more >Smarter Shared Kotlin Flows - Christophe Beyls - Medium
To achieve this, a repository can send an invalidation signal to the observer of the data after each completed write operation (create/update/delete), ...
Read more >The Complete Guide to Rails Caching - Speedshop
Caching in a Rails app is a little bit like that one friend you sometimes have around for dinner, but should really have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are right.
Thanks, the new
@beta
seems to be working in sandbox, but I can’t make it work in my app.Hit a couple of roadblocks upgrading…
cacheRedirects
, but it seems to be missing in beta.Would you be able to expand migration guide on those areas so I can test it in a real app?