You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @ach5910 👋🏻 thanks for letting us know! I'll chat with the team soon to see if there's anything that immediately jumps out as a bug in Apollo Client. Are you able to reproduce this issue in a clean app (e.g. without the other libraries)?
@bignimbus Unfortunately I couldn't reproduce the bug in a sandboxed app due to the complexity of mirroring our production app's infrastructure. I know that not much help in diagnosing the problem, but I was really hoping I was missing something basic and I'd get a "RTFD" response.
@Nehal-Zeller I found a solution by calling client.cache.reset() instead of client.clearStore() or client.resetStore(). I believe any active requests will update the cache if returned after resetting, but it beats having the app crash. Hope this helps!
Issue Description
If
client.clearStore
is called while a query response is pending, it's causing a crashing at this location https://github.com/apollographql/apollo-client/blob/main/src/react/hooks/useQuery.ts#L635.I am using
apollo3-cache-persist@0.14.1
apollo-link-token-refresh@0.6.1
@muchobien/apollo-persistence-mapper@npm:^1.0.0
apollo-link-sentry@3.3.0
and here's how I am initializing my client
I've also tried using
resetStore
, but I get the same error. Any feedback regarding a potential cause is greatly appreciated.Link to Reproduction
N/A
Reproduction Steps
No response
@apollo/client
version3.9.11
The text was updated successfully, but these errors were encountered: