Regression PR 8826 broke cache.reset()
See original GitHub issueIntended outcome:
Before #8826 was introduced we used cache.reset()
to not only reset the cache but also recall all active query watchers. (much like client.resetStore()
).
However, I noticed that https://github.com/apollographql/apollo-client/pull/8826#discussion_r714166464 seems to break this functionality
This seems to be a regression (Or were we using this wrong) as now the store is reset but no active queries are called again.
Actual outcome: I’d Expect the active query watchers to be called as it worked before
How to reproduce the issue:
Call cache.reset()
before and after #8826
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Memory leak on SSR after upgrading from 2.x to 3.3.13 #7942
Call renderPromises.clear() at end of getDataFromTree work. ... Using no-cache for the warchQuery fixes the memory leak, but breaks SSR.
Read more >Advanced topics on caching in Apollo Client
To reset the cache without refetching active queries, use client.clearStore() instead of client.resetStore() . Responding to cache resets. You can register ...
Read more >Hazelcast IMDG Release Notes
Fixed an issue where the map.clear() and cache.clear() methods were evicting all entries in all near caches of all the maps in a...
Read more >Bug listing with status RESOLVED with resolution FIXED as at ...
... Bug:1569 - "Wrong/broken driver for DPT PM2144UW SCSI RAID Caching Controller" status:RESOLVED resolution:FIXED severity:blocker ...
Read more >Changelog — PyTorch Lightning 1.8.6 documentation
Added a warning when the model passed to LightningLite.setup() does not have ... Fixed epoch-end logging results not being reset after the end...
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
@benjamn Thanks for the quick response. I think it fixes the issues but my engineers have told me that
cache.reset()
actually broke between 3.3.21 and 3.4.0 which was rather unexpected (they first told me it was related to this and then they ran through downgrading until they got to 3.3.21 which they said worked)Looking at the code though it looks like the watchers should refetch even in 3.4.0 and especially after your work in #8826 so the investigation continues but without the work in #8826 it definitely wouldn’t have worked at all.
Either way this specific issue is resolved. If I find something else I’ll open a new issue in regards to that but again #8826 was still needed because it brings back watchers being able to refetch at least
@benjamn Thanks for pointing me in the right direction!