Optimistic store update is hidden after a local derived-store write inside an action
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
- 领域
- frontend
调研方向
The report provides a playground reproduction but names no source files or tests. Start by running the reproduction and tracing how createOptimisticStore handles the local derived-store write and the following optimistic write while the action is pending. Done means the view shows New / saving: true during the save and reconciles to the authoritative source after completion.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
On experimental build 6f77b1b, writing a client-only flag to a writable derived store inside an action prevents a subsequent optimistic store update from appearing while that action is pending.
The optimistic store wraps the derived store. The local write only sets failed = false; the optimistic write changes title to "New" and sets saving = true. A direct JSX binding keeps showing "Old" and saving: false until the action completes.
const [cards, setOptimistic] = createOptimisticStore(local);
const save = action(function* () {
setLocal(draft => { draft[0].failed = false; });
setOptimistic(draft => {
draft[0].title = "New";
draft[0].saving = true;
});
yield completion;
});
Removing the setLocal call makes the optimistic update appear. The reproduction uses a normal component and direct text binding, without For, Show, routing, or external data loading.
Your Example Website or App
https://s.olid.uk/id/d27cf7de-2cc1-45a8-9144-6868e307a78f
Steps to Reproduce the Bug or Issue
- Open the playground and click Run once.
- During the two-second simulated save, observe
Old / saving: falseinstead of the optimistic values. - After completion, the display changes to
New / saving: false. The report records both states. - Reload and remove the marked
setLocalcall to compare: the optimistic values appear during the save.
Expected behavior
The optimistic view should immediately show New / saving: true while the action is pending, including when the action first writes to its underlying local store. After completion, it should follow the authoritative source with the temporary saving flag removed.
Platform
- OS: Linux (Ubuntu / WSL)
- Browsers: Chromium 153.0.8010.12 and Firefox 155.0; identical results
- Solid:
solid-js,@solidjs/web, and@solidjs/signalsfrom the Zulu6f77b1bpreview: https://github.com/mizulu/solid2/issues/1#issuecomment-5993985409 - Native compiler:
@solidjs/compiler2.0.0-rc.13
Additional context
The identical reproduction with published RC.13 is here: https://s.olid.uk/id/cf602874-eee9-400c-bd96-3022a77b7291
| With the local flag write | RC.13 | 6f77b1b |
|---|---|---|
| During the pending action | New / saving: true |
Old / saving: false |
| After completion | Old / saving: false |
New / saving: false |
RC.13 shows the optimistic update correctly but suppresses the later source reconciliation discussed in #3733. The newer build reconciles correctly after completion, but loses the optimistic display while pending. Both playgrounds have Tailwind disabled.
- 主要语言
- TypeScript
- 星标
- 36.1k
- 派生
- 1.1k
- 平均合并
- 11 小时 42 分钟
- 30 天内合并 PR
- 326
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/solid 的其他 Issue
-
[2.0 next, regressed after rc.13] Async-generator action times out on its authoritative live echo未关闭
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 75/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 64/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
Bump Firebase JS SDK (12.19.0 → 13.0.0)可能已有人在做 @SelaseKay 今天认领。 未关闭Needs Attention type: enhancement
难度 2/5 1-3 小时 新手友好度 75/100
invertase/react-native-firebase#9364 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 4 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 78/100
redhat-developer/rhdh-plugin-export-overlays#4261 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug] 官网文档的图片挂了未关闭bug
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
area:cli bug triage:in-progress
难度 1/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复