Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Angular query: Optimistic updates are not synchronous

未关闭
#9,735 7 条评论 2 个 reaction 已指派 1 人 在 GitHub 查看

@arnoud-dv 已经在做这个了。

开始于 2025年10月21日。

评估

这个 Issue 还没有评估数据。

描述

package: angular-query
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

https://stackblitz.com/edit/stackblitz-starters-hn17w1mv?file=src%2Fmain.ts,src%2Findex.htmlhttps://stackblitz.com/edit/stackblitz-starters-hn17w1mv?file=src%2Fmain.ts,src%2Findex.html

Steps to reproduce
  1. Click the "edit" button
  2. Change "whatever" to just "w"
  3. 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

主要语言
TypeScript
星标
50.3k
派生
4.2k
平均合并
22 小时 33 分钟
30 天内合并 PR
214

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TanStack/query 的其他 Issue

查看 TanStack/query 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。