Memo over an error boundary output: a rejection during a held change halts uncaught

已关闭
#4,640 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
18/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
领域
frontend

调研方向

Start with the reproduction in the issue: createErrorBoundary wrapping a memo over a promise, then a memo over the boundary output, flushed during a held change. Compare the render-effect-reads-boundary case, which works, with the memo case, which halts. The scheduler's handling of held changes and rejected sources in the signals package is where the fix would live. Done means the second rejection is caught by the boundary, the render effect shows ERR, and nothing escapes as an uncaught error.

由索引模型根据 Issue 内容生成。

描述

A memo over an error boundary's output halts the scheduler when the boundary's source rejects during a held change. The rejection escapes as an uncaught error, and the screen stays on the old value instead of showing the boundary's fallback. If the render effect reads the boundary output directly, the fallback shows as expected.

import { createErrorBoundary, createMemo, createRenderEffect, createRoot, createSignal, flush, untrack } from "@solidjs/signals";

const asks = [];
let screen = "-";
const [sel, setSel] = createSignal(3);
createRoot(() => {
  const detail = createMemo(() => { sel(); return new Promise((res, rej) => asks.push({ res, rej })); });
  const shown = untrack(() => createErrorBoundary(() => detail(), () => "ERR"));
  const t = createMemo(() => shown());            // remove this memo and it works
  createRenderEffect(() => t(), v => { screen = v; });
});
// settle first ask with "A"  -> screen "A"
// setSel(1); flush()         -> held change, screen "A"
// reject second ask "boom"   -> uncaught "boom", screen stays "A" (expected "ERR")
shape after reject
render effect reads the boundary output directly ERR
render effect reads a memo over the output uncaught boom, screen A

The same uncaught error shows up when the memo is read under a <Loading> (without on). The bug is on next. Review of #4639 found it while probing error boundaries built outside a Loading.


Generated by Claude Code

主要语言
TypeScript
星标
36.2k
派生
1.1k
平均合并
9 小时 58 分钟
30 天内合并 PR
474

环境准备

从这里开始

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

solidjs/solid 的其他 Issue

查看 solidjs/solid 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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