`useLiveSuspenseQuery` leaves a derived collection pending after parameterized nested-query re-evaluation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.9k
- Forks
- 266
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 55
Description
Describe the bug
A derived collection created by a parameterized nested query renders for its
first document but remains pending when the parameter changes to a second
document. The identical query succeeds with useLiveQuery.
To reproduce
https://github.com/meesvandongen/tanstack-db-repro
pnpm install
pnpm run repro
The example displays a Documents view and a Tags view. The Tags view evaluates
a query for the selected document:
Document -> folder membership -> folder -> tag
The test changes the selected document through the UI and performs:
- Select Documents.
- Select Document A.
- Select Details, then Tags.
- Return to Documents.
- Select Document B.
- Select Details, then Tags.
Output:
useLiveSuspenseQuery Document A 1
useLiveSuspenseQuery Document B 0
useLiveQuery Document A 1
useLiveQuery Document B 1
The number is the count of rendered tag views. The first two lines use
useLiveSuspenseQuery; the last two are the useLiveQuery control.
Expected behavior
Both Document A and Document B should render their tag view.
Actual behavior
The second useLiveSuspenseQuery view does not render within the test
interval, while the non-Suspense control renders both views.
Versions:
@tanstack/db:0.6.17@tanstack/electric-db-collection:0.3.15@tanstack/react-db:0.1.95react:19.2.8vite:8.2.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in the linked tanstack-db-repro project with pnpm install and pnpm run repro, following the documented document-selection sequence. Compare the useLiveSuspenseQuery and useLiveQuery results; done means both Document A and Document B render their tag views within the test interval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100