Describe the bug#
In some cases, TanStack query can return incorrect data when multiple related keys are used
Your minimal, reproducible example#
https://stackblitz.com/edit/vitejs-vite-a9azfw?file=src%2FApp.vue
Steps to reproduce#
- Go to this StackBlitz example.
- Read through the synopsis and expected behavior
- Click "swap" twice
- Notice that the invariants have been violated, and that incorrect data is being shown
Expected behavior#
Reactivity updates should happen all at once so that invalid states cannot be observed
How often does this bug happen?#
Every time
Screenshots or Videos#
No response
Platform#
macOS Chrome 116.0.5845.110
Tanstack Query adapter#
vue-query
TanStack Query version#
4.34.0
TypeScript version#
5.0.2
Additional context#
No response
@DamianOsipiuk fyi