latest() of an unread identity memo returns undefined when first read in the flush that re-asks its source
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
- 52/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Start with the issue’s reproducer and trace the first read of latest(id) alongside isPending(id) when the Loading boundary mounts. Compare that case with creating the identity memo inside the mounted content, where the bug does not occur. Done when the reproducer no longer yields latest(id) === undefined after m has answered, while pending behavior remains correct.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
On next (e49b0c769), latest() can return undefined, which D-22 rules out ("It returns T, never undefined").
Setup:
mis an async memo, andid = createMemo(() => m())is an identity memo created at the root. Nothing readsidyet.m's first answer (2) lands in its own flush.- A write then re-asks
m. In that same flush, aLoadingboundary mounts content whose render effect readslatest(id)andisPending(id).
The effect's first run sees latest(id) === undefined and isPending(id) === true. Because m has been answered, latest(id) should be 2. If id is created inside the mounted content instead, the bug does not happen.
const asks: { v: number; resolve: (v: number) => void }[] = [];
const [s, setS] = createSignal(1);
const m = createMemo(() => { const v = 1 + s(); return new Promise<number>(resolve => asks.push({ v, resolve })); });
const id = createMemo(() => m());
const leaves: string[] = [];
createRoot(() => {
const b = createLoadingBoundary(() => {
const gate = createMemo(() => s() > 1);
return createMemo(() => {
if (!gate()) return "off";
createRenderEffect(() => `l:${latest(id)} p:${isPending(id)}`, v => void leaves.push(v));
return "on";
});
}, () => "fallback");
createRenderEffect(() => { let v: any = b; while (typeof v === "function") v = v(); return v; }, () => {});
});
flush(); await task(); flush();
const first = asks.shift()!; first.resolve(first.v);
await task(); flush(); // m's answer (2) lands on its own
setS(2); await task(); flush(); // re-ask m and mount the content
// leaves: ["l:undefined p:true", ...]
Found while reviewing #4459; #4459 does not change it.
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.2k
- Forks
- 1.1k
- Merge medio
- 11 h 48 min
- PR fusionados (30 d)
- 441
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de solidjs/solid
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
solidjs/solid#4447 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid
Issues similares
-
BeOS .json missingAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mihaip/infinite-mac#475 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
marmelab/atomic-crm#401 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Deltares/webgl-streamline-visualizer#83 ·
Los mantenedores suelen responder en 1 día
-
ubicloud: usage is an awk syntax error on macOS, which also disables the vCPU quota preflightAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día