Angular query: Optimistic updates are not synchronous
Les mainteneurs répondent en général sous 1 jour
@arnoud-dv y travaille déjà.
Depuis le 21/10/2025.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Describe the bug
Here's a stackblitz that repro's the issue about 20% of the time (I think it's timing related): https://stackblitz.com/edit/stackblitz-starters-hn17w1mv?file=src%2Fmain.ts,src%2Findex.html
If you click "edit" and change the "whatever" to just "1", then tab out to trigger blur, you'll see the "whatever" show up for 1 frame. I think this is happening because the optimistic update (which should set the title to "1") is not happening until the next frame. So when I set the "isEditingTitle" signal to false, it flickers the old title for 1 frame. I would expect the optimistic update to be immediate and synchronous, like how normal signals behave, so this flicker never happens.
Generally speaking, this can happen whenever you have a UX that let's the user preview an edit before committing it. In this case, the preview is the input text box, and commiting it is blurring. It would be even more noticeable if the input field looked exactly like the non-editing text.
What are people's thoughts on this? Is this not a use case many encounter?
Your minimal, reproducible example
Steps to reproduce
- Click the "edit" button
- Change "whatever" to just "w"
- Press Tab to trigger blur and finish editing.
Expected behavior
20% of the time, you'll see "whatever" show up for 1 frame. Desired behavior: I would expect the optimistic update to immediately take effect, and the text immediately shows "w".
How often does this bug happen?
Sometimes
Screenshots or Videos
No response
Platform
- OS: macOS
- Browser: Google Chrome, Version 141.0.7390.54 (Official Build) (arm64)
Tanstack Query adapter
angular-query
TanStack Query version
^5.69.1
TypeScript version
^5.6.3
Additional context
No response
- Langage dominant
- TypeScript
- Étoiles
- 50.3k
- Forks
- 4.2k
- Merge moyen
- 23 h 7 min
- PR mergées (30 j)
- 231
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TanStack/query
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
TanStack/query#11358 · 2 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
TanStack/query#11106 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 58/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 74/100
TanStack/query#11639 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de TanStack/query
Issues similaires
-
ADD openalgoOuvertetemplate
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
vercel/ai#21528 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
bug Needs: Triage :mag:
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
microsoft/fluentui-contrib#671 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
sveltejs/acorn-typescript#150 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100