Skip to content

Conversation

@TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Mar 8, 2025

we have an optimized shouldNotifyListeners logic internally in the QueryObserver that will make sure we only notify listeners that are interested in a change because they are using a specific key (tracked query properties)

the optimization to force a skip of the notification when updating options because the optimistic result should already contain all the necessary output falls apart in the situation described in the test and in the linked issue #8741.

while the issue itself is a niche edge-case, the fix is to actually remove a bunch of code, so I'm all for it

fixes #8741

we have an optimized `shouldNotifyListeners` logic internally in the QueryObserver that will make sure we only notify listeners that are interested in a change because they are using a specific key (tracked query properties)

the optimization to force a skip of the notification when updating options because the optimistic result should already contain all the necessary output falls apart in the situation described in the test and in the linked issue #8741.

while the issue itself is a niche edge-case, the fix is to actually remove a bunch of code, so I'm all for it
@nx-cloud
Copy link

nx-cloud bot commented Mar 8, 2025

View your CI Pipeline Execution ↗ for commit ab0ff6c.

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 3m 13s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2m View ↗

☁️ Nx Cloud last updated this comment at 2025-03-27 20:01:41 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 8, 2025

Open in Stackblitz

More templates

@tanstack/angular-query-devtools-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@8771

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@8771

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@8771

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@8771

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@8771

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@8771

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@8771

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@8771

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@8771

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@8771

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@8771

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@8771

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@8771

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@8771

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@8771

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@8771

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@8771

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@8771

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@8771

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@8771

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@8771

commit: ab0ff6c

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2025

Sizes for commit ab0ff6c:

Branch Bundle Size
Main
This PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lachlancollins for the svelte-query persist plugin, there seems to now be one additional render / update. Interestingly, this doesn’t happen for the react adapter. we have the same tests and had the same assertions until now.

@codecov
Copy link

codecov bot commented Mar 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.39%. Comparing base (b23bb39) to head (ab0ff6c).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #8771       +/-   ##
===========================================
+ Coverage   46.60%   63.39%   +16.78%     
===========================================
  Files         200      136       -64     
  Lines        7576     4860     -2716     
  Branches     1744     1371      -373     
===========================================
- Hits         3531     3081      -450     
+ Misses       3669     1538     -2131     
+ Partials      376      241      -135     
Components Coverage Δ
@tanstack/angular-query-devtools-experimental ∅ <ø> (∅)
@tanstack/angular-query-experimental 88.08% <100.00%> (ø)
@tanstack/eslint-plugin-query ∅ <ø> (∅)
@tanstack/query-async-storage-persister 43.85% <ø> (ø)
@tanstack/query-broadcast-client-experimental ∅ <ø> (∅)
@tanstack/query-codemods ∅ <ø> (∅)
@tanstack/query-core 94.82% <100.00%> (-0.01%) ⬇️
@tanstack/query-devtools 4.78% <ø> (ø)
@tanstack/query-persist-client-core 57.73% <ø> (ø)
@tanstack/query-sync-storage-persister 84.61% <ø> (ø)
@tanstack/react-query 95.42% <100.00%> (ø)
@tanstack/react-query-devtools 10.00% <ø> (ø)
@tanstack/react-query-next-experimental ∅ <ø> (∅)
@tanstack/react-query-persist-client 100.00% <ø> (ø)
@tanstack/solid-query 78.20% <ø> (ø)
@tanstack/solid-query-devtools ∅ <ø> (∅)
@tanstack/solid-query-persist-client 100.00% <ø> (ø)
@tanstack/svelte-query 87.33% <100.00%> (ø)
@tanstack/svelte-query-devtools ∅ <ø> (∅)
@tanstack/svelte-query-persist-client 100.00% <ø> (ø)
@tanstack/vue-query 71.01% <ø> (ø)
@tanstack/vue-query-devtools ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TkDodo TkDodo merged commit 1b54538 into main Mar 28, 2025
7 checks passed
@TkDodo TkDodo deleted the feature/missing-fetchStatus-updates branch March 28, 2025 08:18
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.

React Query - Missing fetchStatus changes for disabled queries with dynamic keys

2 participants