Hydration runs an async memo over latest(...) of a hydrated chain with undefined and re-asks
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
- 领域
- frontend
调研方向
Start by reading the hydration and latest() implementation, then inspect the async memo tests and the behavior described in the reproduction. Reproduce hydration with the shell arriving before streamed chunks, and check that fetchC is not called before the first client write. Done when latest() on an uninitialized node throws in every scope and hydration claims the streamed value without refetching.
由索引模型根据 Issue 内容生成。
描述
Found by the async app generator's hydration phase (#4371). Reproduces on next 5f60713a. It looks like the hydration side of #4363 (latest() returns undefined, which breaks A7), and it also breaks no-refetch.
const [s] = createSignal(3);
function App() {
const m0 = createMemo(() => fetchA(1 + s())); // 4
const m1 = createMemo(() => fetchB(1 + latest(m0))); // 5
const m2 = createMemo(() => fetchC(1 + latest(m1))); // 6
return (
<main>
<Errored fallback={e => "[ROOT-E]"}>
<Loading fallback="[ROOT-L]">
<span data-a={String(m2())} />
</Loading>
</Errored>
</main>
);
}
The server streams all three answers (4, 5, 6) and the fragment <span data-a="6">. A client that hydrates the shell before the chunks arrive calls fetchC(NaN) for real. So latest(m1) returned undefined inside m2's compute during hydration, and that compute asked again instead of claiming the streamed 6.
Expected: no ask before the first client write, and latest() of an uninitialized node throws in every scope, never undefined (A7).
- 主要语言
- TypeScript
- 星标
- 36.2k
- 派生
- 1.1k
- 平均合并
- 10 小时 28 分钟
- 30 天内合并 PR
- 379
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/solid 的其他 Issue
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14可能已有人在做 @itisrmk 于 11 天前认领。 未关闭1.x
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 51/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
[2.0 / next] A memo reading latest(a) beside b() computes a torn pass on a batched write; if that pass throws, the error sticks可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 1-2 天 新手友好度 48/100
维护者通常 1 天内回复
-
[2.0 / next] latest(m) returns undefined for an uninitialized async memo after its latest() input changes (A7)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
area:plugins area:security area:skills bug has repro
难度 2/5 1-3 小时 新手友好度 76/100
anthropics/claude-code#105911 ·
维护者通常 1 天内回复
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifacts未关闭
难度 2/5 1-3 小时 新手友好度 72/100
Fission-AI/OpenSpec#2165 ·
维护者通常 1 天内回复
-
🐞 bug 🧐 unconfirmed
难度 2/5 1-3 小时 新手友好度 66/100
Tencent/tdesign-vue-next#7032 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
gnosis/gnosis_vpn#661 ·
维护者通常 1 天内回复
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)未关闭triage:bug-verified
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 1 天内回复