rc.14: an effect that catches NotReadyError from an async store is never re-run when the store settles
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
- Ambito
- frontend
Direzione di ricerca
Start with the headless repro.mjs in the issue, which pins @solidjs/signals to 2.0.0-rc.13 and then rc.15 to compare effect re-runs. The payload names no source files, so locate where NotReadyError is thrown for async store derives and where an effect is scheduled to re-run when that derive settles. Done means the effect with try/catch records ["not-ready","len=1"] again on the current version, matching rc.13, and the without-try/catch case still passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
@solidjs/[email protected] and rc.15 (dev and prod builds). Regression since rc.13.
An effect whose compute reads an async-seeded store (createStore(async fn, [])) and catches the NotReadyError that read throws runs once with its fallback value and is never re-run when the store's seed settles. The store itself settles: an untracked read afterwards returns the data. The same effect without the try/catch holds and then runs once with the settled value, as before. An async createMemo read the same way is still re-run on rc.15, so this looks specific to async store derives.
const [rows] = createStore(async () => await request, []);
createEffect(
() => { try { return `len=${rows.length}`; } catch { return "not-ready"; } },
(v) => seen.push(v),
);
// rc.13: ["not-ready", "len=1"] rc.14 / rc.15: ["not-ready"], forever
Reproduction (headless, only @solidjs/signals)
mkdir solid-catch-notready && cd solid-catch-notready
npm init -y >/dev/null && npm pkg set type=module && npm i @solidjs/[email protected] >/dev/null
cat > repro.mjs <<'JS'
// An effect whose compute catches NotReadyError from an async-seeded store
// is re-run when the seed settles (rc.13) — or never again (rc.14, rc.15).
import { createEffect, createRoot, createStore, flush } from "@solidjs/signals";
const tick = (ms) => new Promise((r) => setTimeout(r, ms));
for (const caught of [false, true]) {
let resolve;
const request = new Promise((r) => (resolve = r));
const seen = [];
const dispose = createRoot((dispose) => {
const [rows] = createStore(async () => await request, []);
createEffect(
() => {
if (!caught) return `len=${rows.length}`;
try { return `len=${rows.length}`; } catch { return "not-ready"; }
},
(v) => { seen.push(v); },
);
return dispose;
});
flush();
resolve([{ id: "a" }]);
await tick(10);
flush();
console.log(`${caught ? "with try/catch " : "without try/catch"}: ${JSON.stringify(seen)}`);
dispose();
}
JS
node repro.mjs
@solidjs/signals |
without try/catch | with try/catch |
|---|---|---|
| 2.0.0-rc.13 | ["len=1"] |
["not-ready","len=1"] |
| 2.0.0-rc.14 | ["len=1"] |
["not-ready"] |
| 2.0.0-rc.15 | ["len=1"] |
["not-ready"] |
Replacing the store with const memo = createMemo(async () => await request) (reading memo().length) gives ["not-ready","len=1"] on rc.15.
(Pin @solidjs/signals directly: npm i [email protected] alone installs the newest signals through its caret dependency.)
Where we hit it
@dschz/solid-flow pins its async store factories (createNodeStore(async () => …), a thin wrapper over createStore(fn, [])) with this exact effect, which records "not-ready" until the first value and then the row count. Two of its tests fail on rc.14 and rc.15. The library itself never catches NotReadyError, so for us this is a test idiom, but a user's effect that degrades gracefully while data loads would stay on its fallback forever.
If catching NotReadyError in a compute is not a supported pattern, a dev diagnostic for it would help: today the effect silently never updates.
- Lingua principale
- TypeScript
- Stelle
- 36.1k
- Fork
- 1.1k
- Merge medio
- 12h 10m
- PR unite (30g)
- 338
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di solidjs/solid
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14Forse già presa @itisrmk l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
I maintainer di solito rispondono entro 1 giorno
-
[2.0 / next] Error formatting and async iterator protocol failures escape memo error handlingAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 14/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di solidjs/solid
Issue simili
-
Object parameters lose their structure when resources is enabledForse già presa @asts-top l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
jaegertracing/jaeger-ui#4618 ·
I maintainer di solito rispondono entro 1 giorno
-
pending close triaging
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
anomalyco/opencode#56765 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:plugins enhancement platform:vscode
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
anthropics/claude-code#103166 ·
I maintainer di solito rispondono entro 1 giorno
-
Types: FlashListProps imports ViewabilityConfig from react-native, removed in RN 0.87+Forse già presa @efegokdemir l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Shopify/flash-list#2540 ·