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

🐛 Bug: apollo-link-rest shares a single global for @export(as:) elements, breaking concurrency #81

Closed
fbartho opened this issue Feb 26, 2018 · 0 comments
Labels

Comments

@fbartho
Copy link
Collaborator

fbartho commented Feb 26, 2018

As currently implemented, apollo-link-rest shares a single global hash for @export(as: "foo") annotated data.

https://github.com/apollographql/apollo-link-rest/blob/master/src/restLink.ts#L541

This hash gets reset once per GraphQL request, but since requests can happen in parallel, technically, this means they're clobbering each other, and could lead to data-corruption / intermittent timing-related crashes.

fbartho added a commit that referenced this issue Feb 26, 2018
Calling `fieldNameNormalizer` ourselves before letting the response escape our hands is safer, as apollo-client can't mangle it then.

Fixes: #81
Also fixes: `fieldNameNormalizer`/`Denormalizer` test-cases had some bugs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant