Describe the bug
In our app we allow user to switch between workspaces, and when they do we want an entirely different set of query cache / query client combo to isolate the data between workspaces. However simply changing the client provided to QueryClientProvider does not cause queries to refetch. Even manually calling refetch doesn't fully resolve the issue because the Observer has a constant reference to the previous QueryClient that does not update.
See trpc/trpc#4153 (comment) for additional context
Your minimal, reproducible example
https://github.com/tonyxiao/next-turbopack-example/blob/main/packages/app1/app/debug/page.tsx
Steps to reproduce
- Type into the slug field to cause queryClient to change
- Notice that value of
res.data stays the same
Expected behavior
I would expect 1) All the queries to refetch and 2) Either new observers to be created or for the existing observer to update their query client reference.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
All platforms
Tanstack Query adapter
None
TanStack Query version
4.29.7
TypeScript version
No response
Additional context
No response
Describe the bug
In our app we allow user to switch between workspaces, and when they do we want an entirely different set of query cache / query client combo to isolate the data between workspaces. However simply changing the client provided to QueryClientProvider does not cause queries to refetch. Even manually calling refetch doesn't fully resolve the issue because the Observer has a constant reference to the previous QueryClient that does not update.
See trpc/trpc#4153 (comment) for additional context
Your minimal, reproducible example
https://github.com/tonyxiao/next-turbopack-example/blob/main/packages/app1/app/debug/page.tsx
Steps to reproduce
res.datastays the sameExpected behavior
I would expect 1) All the queries to refetch and 2) Either new observers to be created or for the existing observer to update their query client reference.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
All platforms
Tanstack Query adapter
None
TanStack Query version
4.29.7
TypeScript version
No response
Additional context
No response