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

fix(setQueryData) unresolved promises #645

Merged
merged 1 commit into from
Jun 28, 2020
Merged

Conversation

franleplant
Copy link
Contributor

@franleplant franleplant commented Jun 27, 2020

setQueryData(notInstantiatedQueryKey) now assigns Promise.resolve() instead of new Promise(noop) that caused a never ending promise en certain scenarios. Ref bug #639

EDIT
Forgot to mention that I went with Promise.resolve because in some other place we do const promise = fn(...) and if we simply make fn a noop then promise will be undefined and when we later do promise.cancel it will break. (typescript would help us in this case)

Here is where we access promise.cancel https://github.com/tannerlinsley/react-query/blob/1.x/src/queryCache.js#L375

…Promise.resolve() instead of new Promise(noop) that caused a never ending promise en certain scenarios. Ref bug TanStack#639
@tannerlinsley tannerlinsley merged commit 5546670 into TanStack:1.x Jun 28, 2020
@franleplant
Copy link
Contributor Author

thanks @tannerlinsley , sorry to bug you, is this going to be published automatically by github actions or do we need to do it manually?

@tannerlinsley
Copy link
Collaborator

It should have been released. I’ll check it out

@tannerlinsley
Copy link
Collaborator

🎉 This PR is included in version 1.5.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants