Skip to content
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

QueryManager.broadcastQueries may use incorrect map ID #4593

Closed
davewthompson opened this issue Mar 18, 2019 · 2 comments
Closed

QueryManager.broadcastQueries may use incorrect map ID #4593

davewthompson opened this issue Mar 18, 2019 · 2 comments

Comments

@davewthompson
Copy link

(Not sure this is 100% correct; please verify)

I think the broadcastQueries function may be using the incorrect ID when it invokes callbacks. I've noticed this when my React components have been supplied with incorrect callback data. In one example, the REST provider invoked the same callback twice with different data, breaking my code.

My guess here is that the incorrect ID is being extracted from the map enumeration inside the iterator; if you look at the attached image, you can see a query with ID of 14 is received, but inside broadcastQueries a callback of ID 4 is being invoked; this means my component gets the wrong data.

querymanager-behaviour

Version data:
System:
OS: macOS High Sierra 10.13.6
Binaries:
Node: 11.6.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
Browsers:
Chrome: 72.0.3626.121
Safari: 12.0.3
npmPackages:
apollo-cache-inmemory: ^1.4.2 => 1.4.3
apollo-client: ^2.4.12 => 2.4.13
apollo-link: ^1.2.8 => 1.2.8
apollo-link-error: ^1.1.7 => 1.1.7
apollo-link-http: ^1.5.11 => 1.5.11
apollo-link-rest: ^0.7.0 => 0.7.0
apollo-link-retry: ^2.2.10 => 2.2.10
react-apollo: ^2.4.1 => 2.4.1

@davewthompson
Copy link
Author

After more research, I think this is caused by apollographql/apollo-link-rest#197; specifically, the caching engine is incorrectly setting values because it isn't replacing the arguments properly.

@davewthompson
Copy link
Author

Definitely cache related; if I disable the cache with "no-cache" network policy then everything works as intended. I will close this issue and chase up with the REST provider.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant