query: Incorrectly works in Concurrent mode with Suspense
Describe the bug
When query key changes, all the subsequent queries become inactive immediately and never revalidate
To Reproduce Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/dreamy-pond-5y7fd?file=/src/App.tsx
- Open dev tools, there is one stale query (correct)
- Press “Next”
- There are two stale queries in dev tools (incorrect)
Expected behavior There should be one inactive and one stale query
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 17 (2 by maintainers)
Hi @vimcaw! Yes I think suspense should indeed also be triggered when switching to a new query. Fixed in
3.2.0-beta.22Seems to be working correctly in V3: https://codesandbox.io/s/mutable-dream-7fubu
We are experiencing this bug in Blitz apps too.
From my investigation, this broke in
2.7.0.@tannerlinsley I know you are working on v3, so I’m curious if this might be fixed in
2.xor not?Hi @dburles! Yes that should be fixed. The devtools still need to be updated but you can click the “Log” button in the previous playground I posted to check how many observers the queries have.