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

オープン
#4,640 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
18/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, typescript
領域
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
平均マージ
10時間 39分
マージ済み PR(30日)
500

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

solidjs/solid のほかの issue

solidjs/solid の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。