2.0.0-rc.14: until() through a synchronous memo misses optimistic confirmation
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
Start by reproducing with the playground component in the issue, then swap the predicate between doubled() and count() to confirm the memo is the difference. The payload names no source files, so you will need to find where until() subscribes and how a synchronous createMemo propagates optimistic values on confirmation. Done when yield until(() => doubled() === 2) completes after setSource(1), matching the direct-read control.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
On 2.0.0-rc.14, an action waiting with until() through a synchronous memo remains pending when the actual source confirms its optimistic prediction. Reading the optimistic accessor directly in the predicate completes the same action.
The predicate subscribes before confirmation arrives. The prediction alone correctly does not satisfy the wait, but confirming it does not resolve the wait through the memo either.
Your Example Website or App
https://s.olid.uk/?id=d1d1a3ee-70c8-4afe-966d-258809cb4f06
The playground uses published 2.0.0-rc.14. Here is the full component, including the actual source update in the Confirm button:
import { action, createMemo, createOptimistic, createSignal, until } from "solid-js";
import { render } from "solid-js/web";
function App() {
const [source, setSource] = createSignal(0);
const [count, guess] = createOptimistic(() => source());
const doubled = createMemo(() => count() * 2);
const [completed, setCompleted] = createSignal(false);
const save = action(function* () {
guess(1);
yield Promise.resolve();
// Direct-read control: yield until(() => count() === 1);
yield until(() => doubled() === 2);
});
return (
<main>
<button onClick={() => save().then(() => setCompleted(true))}>1. Start</button>
<button onClick={() => setSource(1)}>2. Confirm</button>
<p>Displayed count: {count()}</p>
<p>Doubled memo: {doubled()}</p>
<p>Action completed: {String(completed())}</p>
</main>
);
}
render(() => <App />, document.getElementById("app")!);
Steps to Reproduce the Bug or Issue
- Open the playground and click 1. Start.
- The displayed count becomes
1and the doubled memo becomes2. Action completion remainsfalse, as expected while the prediction is unconfirmed. - Click 2. Confirm to set the actual source to
1. - Action completion still remains
false. - Change the wait to
yield until(() => count() === 1), rebuild, and repeat. Action completion becomestrueafter confirmation.
Both the failing memo case and the successful direct-read control were verified in the browser.
Expected behavior
The optimistic prediction alone should not satisfy until(). Once the actual source confirms the prediction, the predicate through the synchronous memo should resolve and the action should complete, just as the direct-read predicate does.
Platform
- OS: Linux (WSL)
- Browser: Chrome for Testing 153.0.8010.12, tested with Playwright
- Solid:
2.0.0-rc.14
- 主要语言
- TypeScript
- 星标
- 36.1k
- 派生
- 1.1k
- 平均合并
- 11 小时 25 分钟
- 30 天内合并 PR
- 345
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/solid 的其他 Issue
-
难度 5/5 一周以上 新手友好度 12/100
维护者通常 1 天内回复
-
Select loses its bound value when options load asynchronously可能已有人在做 @MokiMeow 于 1 天前认领。 未关闭
难度 3/5 半天 新手友好度 45/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 18/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 24/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 8/100
维护者通常 1 天内回复
相似的 Issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 75/100
lingdojo/kana-dojo#32018 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
paperclipai/paperclip#15751 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
BuilderIO/agent-native#7275 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复