Comments (10)
Am also facing this issue for a while now. Upgraded to @apollo/[email protected]
and am still able to reproduce this error by running a query and then calling client.clearStore()
.
from apollo-client.
I am facing the same issue. I believe that client.cache.reset()
is not killing the pending query thus it will be written to cache once the response is returned.
It's worth to mention that i am encountering this error randomly on react native. I can't easily reproduce that.
from apollo-client.
Hey @jerelmiller, I get the same error stack trace error in node_modules/@apollo/client/react/hooks/useQuery.js
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 clearStore()
in /src/components/Search.js
to simulate it.
Thanks for looking into it!
from apollo-client.
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)?
from apollo-client.
Facing the same error, is there any way we can kill all pending active queries other than clearStore?
from apollo-client.
@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!
from apollo-client.
@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 Store reset while query was in flight (not completed in link chain)
. If the latter, this is expected behavior, but if the former, then a reproduction of the issue would be greatly appreciated.
from apollo-client.
@DerekWang98 I can reproduce your situation, but it's a different bug.
Your codepath comes from complete
while the original issue comes from notifySubscription
. I'll move this over to a new issue :)
from apollo-client.
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.
from apollo-client.
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 :)
from apollo-client.
Related Issues (20)
- Partial data returned on error after resetting cache HOT 6
- Type error returning `IGNORE` object when using a generic `TypedDocumentNode` mutation HOT 2
- Documentataion: mutaitonHookOptions.ignoreResults requires additional clarification HOT 1
- @apollo/client reactive var state changes are not reflecting across libraries HOT 8
- fetchMore with fetchPolicy: "no-cache" makes two requests HOT 5
- Problem with custom type policy for query caching HOT 19
- App Crash when using ReactNativeFile in apollo upload client to upload file HOT 5
- Server-Side Rendering Error with @apollo/client 3.11.0 in NextJS 14.2.5 HOT 3
- When updating the list of mocks and calling 'rerender' on the component under test, the updated list of mocks is ignored and the original is still used. HOT 3
- Check on sample app suggested in the contributing doc
- [useMutation] unexpected handling of mutations vs queries on error handling HOT 2
- Evicting the cache for a query with both @include and @nonreactive directives can cause errors if variables have been changed HOT 1
- Calling `clearStore` while a lazyQuery is pending causes an error HOT 2
- Appolo Client with shopify HOT 2
- valueChanges does not trigger anymore after fetching the same object type from another, separate query HOT 2
- data is not available anymore in the onCompleted callback HOT 3
- `cache-only` fetchPolicy results in network request after deleting cached data HOT 1
- `watchFragment` reports result as complete when `from` object is not identifiable
- [Documentation] Improve clarity on `TypedDocumentNode` in the "Using TypeScript" doc
- [Question] Syntax Errors in `onCompleted` causes `onError` to occur HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-client.