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.

Regression PR 8826 broke cache.reset()

See original GitHub issue

Intended 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:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tm1000commented, Sep 27, 2021

@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

0reactions
tm1000commented, Sep 27, 2021

@benjamn Thanks for pointing me in the right direction!

Read more comments on GitHub >

github_iconTop 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 >

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