Describe the bug#
When the amount of queries in useSuspenseQueries increases, the new queries resolution/suspense is split into two batches.
The first batch takes care of newQueries.slice(0, previousQueries.length) and stops the suspense, causing the rest of the queries to be still pending (and have undefined data) before the second batch (rest of the newQueries) kicks in.
Your minimal, reproducible example#
https://codesandbox.io/p/sandbox/friendly-jang-gjp9p8
Steps to reproduce#
- Click the button.
- Observe the lifecycle of queries in the console.
Expected behavior#
As a user, I would expect newQueries to be resolved all at once in a single suspense.
How often does this bug happen?#
Every time
Screenshots or Videos#
No response
Platform#
Platform agnostic.
Tanstack Query adapter#
react-query
TanStack Query version#
5.4.3
TypeScript version#
5.2.2
Additional context#
No response
I'd like to attempt to fix that. I will keep you posted.