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(react): don't set options before suspending #6611

Merged
merged 4 commits into from
Dec 29, 2023
Merged

fix(react): don't set options before suspending #6611

merged 4 commits into from
Dec 29, 2023

Conversation

TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Dec 29, 2023

setting options right before suspending is a side effect, and it has repercussions if used in transitions where the component stays mounted

to fix #6392 in a different way, we can't rely on observer.getCurrentQuery() when reading for error boundaries / suspense, because it can lag behind; instead, we can just read from the queryCache directly to get the latest values

fixes #6486
fixes #6498

setting options right before suspending is a side effect, and it has repercussions if used in transitions where the component stays mounted

to fix #6392 in a different way, we can't rely on `observer.getCurrentQuery()` when reading for error boundaries / suspense, because it can lag behind; instead, we can just read from the queryCache directly to get the latest values
Copy link

vercel bot commented Dec 29, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Dec 29, 2023 9:29pm

Copy link

nx-cloud bot commented Dec 29, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit a2f75bf. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link

codesandbox-ci bot commented Dec 29, 2023

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 a2f75bf:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration
react-query: useSuspenseQuery does not throw on queryKey change Issue #6392

@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2ed4779) 39.12% compared to head (a2f75bf) 56.16%.
Report is 1 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6611       +/-   ##
===========================================
+ Coverage   39.12%   56.16%   +17.03%     
===========================================
  Files         161       99       -62     
  Lines        6597     4081     -2516     
  Branches     1297     1001      -296     
===========================================
- Hits         2581     2292      -289     
+ Misses       3665     1570     -2095     
+ Partials      351      219      -132     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TkDodo
Copy link
Collaborator Author

TkDodo commented Dec 29, 2023

@TkDodo TkDodo merged commit 639c725 into main Dec 29, 2023
10 checks passed
@TkDodo TkDodo deleted the feature/6486 branch December 29, 2023 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants