-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clearStore causes a crash when there is an active query #11846
Comments
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)? |
Facing the same error, is there any way we can kill all pending active queries other than clearStore? |
@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 |
I am facing the same issue. I believe that It's worth to mention that i am encountering this error randomly on react native. I can't easily reproduce that. |
Am also facing this issue for a while now. Upgraded to |
@DerekWang98 are you seeing the same stack trace and error as the issue description (unexpected), or are you seeing an error with a message of |
Hey @jerelmiller, I get the same error stack trace error in To reproduce the issue, go to search in the sandbox preview and press "OK" to reproduce the bug. I ran a lazy query and then quickly performed Thanks for looking into it! |
@DerekWang98 I can reproduce your situation, but it's a different bug. Your codepath comes from |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better. |
While we can't 100% reproduce it, I believe this will be solved once we release #11989 in the next patch release of Apollo Client. If that isn't the case, let's open a new issue on this :) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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: