Describe the bug
Suspense query keeps suspending when data exists. Originally, I noticed the problem in streamedQuery in combination with useSuspenseQuery. The issue reflects in such way that suspense query keeps suspending even after the first stream chunk is received.
I'd like to note that the aforementioned behaviour could be useful in some cases, but that's a separate issue I guess.
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/cranky-benz-xvt2n2
Steps to reproduce
- Go to https://codesandbox.io/p/sandbox/cranky-benz-xvt2n2?file=%2Fsrc%2FApp.js
- Click the button
- Loading text remains even though the query client has the data for the key
Expected behavior
I'd expect data to show.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
None
TanStack Query version
5.101.0
TypeScript version
No response
Additional context
An idea about solution. Maybe wrapping suspense queryFn result with additional promise could provide more control?
Not sure what is the right way to handle the ongoing promise when the data is set programatically? Should this behaviour be controlled by user through options?
Describe the bug
Suspense query keeps suspending when data exists. Originally, I noticed the problem in
streamedQueryin combination withuseSuspenseQuery. The issue reflects in such way that suspense query keeps suspending even after the first stream chunk is received.I'd like to note that the aforementioned behaviour could be useful in some cases, but that's a separate issue I guess.
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/cranky-benz-xvt2n2
Steps to reproduce
Expected behavior
I'd expect data to show.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Tanstack Query adapter
None
TanStack Query version
5.101.0
TypeScript version
No response
Additional context
An idea about solution. Maybe wrapping suspense queryFn result with additional promise could provide more control?
Not sure what is the right way to handle the ongoing promise when the data is set programatically? Should this behaviour be controlled by user through options?