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

Abierto
#4,640 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
18/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, typescript
Área
frontend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
36.2k
Forks
1.1k
Merge medio
10 h 39 min
PR fusionados (30 d)
500

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de solidjs/solid

Todos los issues de solidjs/solid

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.