Skip to content

fix(query): updating with setQueryData should not affect fetchStatus #3613

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

Conversation

TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented May 13, 2022

queries can be fetching while we are making a manual update are still fetching, so we have to set fields that affect the fetch conditionally (fetchStatus, fetchFailureCount)

fixes #3594

queries can be fetching _while_ we are making a manual update are still fetching, so we have to set fields that affect the fetch conditionally (fetchStatus, fetchFailureCount)
@vercel
Copy link

vercel bot commented May 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-query ✅ Ready (Inspect) Visit Preview May 13, 2022 at 6:43PM (UTC)

@TkDodo TkDodo added the v4 label May 13, 2022
@codesandbox-ci
Copy link

codesandbox-ci bot commented May 13, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6df2ef2:

Sandbox Source
tannerlinsley/react-query: basic Configuration
tannerlinsley/react-query: basic-typescript Configuration
setQueryData_and_isFetching-bug Issue #3594
setQueryData_and_isFetching-bug Issue #3594

@TkDodo
Copy link
Collaborator Author

TkDodo commented May 13, 2022

@lgenzelis fyi

fix logical condition that I screwed up; thank you, tests
@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #3613 (6df2ef2) into beta (e01a7bb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             beta    #3613   +/-   ##
=======================================
  Coverage   96.93%   96.93%           
=======================================
  Files          48       48           
  Lines        2382     2383    +1     
  Branches      709      709           
=======================================
+ Hits         2309     2310    +1     
  Misses         71       71           
  Partials        2        2           
Impacted Files Coverage Δ
src/core/queryClient.ts 100.00% <ø> (ø)
src/core/query.ts 100.00% <100.00%> (ø)
src/core/queryObserver.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e01a7bb...6df2ef2. Read the comment docs.

@TkDodo TkDodo merged commit 7d3f7a2 into TanStack:beta May 14, 2022
@TkDodo TkDodo deleted the feature/3594-setQueryData-incorrectly-resets-isFetching branch May 14, 2022 07:22
@tannerlinsley
Copy link
Collaborator

🎉 This PR is included in version 4.0.0-beta.11 🎉

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.

2 participants