Describe the bug
queryClient.resetQueries() does not work as expected for server-hydrated queries. Hydrated query isLoading state is always false, unlike to queries run on client.
Your minimal, reproducible example
https://codesandbox.io/p/devbox/admiring-frog-rnw27x
Steps to reproduce
There is server-prefetched request with post id = 1;
- Click
reset posts queries (it calls queryClient.resetQueries);
- Notice that query just refetches, cache entry not being reset and
isLoading state is always false;
- Click
increase id button and wait for new post to load;
- Click
reset posts queries again;
- Notice that client-fetched query being reset as expected, cache is reset and
isLoading state becomes true for a moment;
- You can decrease id back to 1 and repeat step
#1 to ensure that resetQueries is not able to reset server-prefetched query
Expected behavior
queryClient.resetQueries is able to reset any query, wether its server fetched or client fetched
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
OS: Windows, browser: Chrome 124.0.6367.78 / Firefox 125.0.2
Tanstack Query adapter
vue-query
TanStack Query version
5.32.0
TypeScript version
No response
Additional context
No response
Describe the bug
queryClient.resetQueries()does not work as expected for server-hydrated queries. Hydrated queryisLoadingstate is alwaysfalse, unlike to queries run on client.Your minimal, reproducible example
https://codesandbox.io/p/devbox/admiring-frog-rnw27x
Steps to reproduce
There is server-prefetched request with post id = 1;
reset posts queries(it callsqueryClient.resetQueries);isLoadingstate is alwaysfalse;increase idbutton and wait for new post to load;reset posts queriesagain;isLoadingstate becomestruefor a moment;#1to ensure thatresetQueriesis not able to reset server-prefetched queryExpected behavior
queryClient.resetQueriesis able to reset any query, wether its server fetched or client fetchedHow often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
OS: Windows, browser: Chrome 124.0.6367.78 / Firefox 125.0.2
Tanstack Query adapter
vue-query
TanStack Query version
5.32.0
TypeScript version
No response
Additional context
No response