You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
2.0: two async sources answered and re-asked in one tick: the second answer is dropped, latest() of their memo throws #4495
Two async memos m1 and m2 both answer, and then a write re-asks both, all in one tick. A memo c = createMemo(() => m1() + m2()) that hadn't read them yet ends up with no value: latest(c) throws NotReadyError, and a Loading fallback over it stays up.
D-22 (RULES-DERIVED) says both answers are produced values: "whether the landing ran before the re-ask reached c is the flush's order". So latest(c) should read 2 + 11 = 13. Answering in its own tick first gives 13 (control case below).
const[s,setS]=createSignal(1);constmk=(off: number)=>createMemo(()=>{constv=off+s();returnnewPromise<number>(resolve=>asks.push({ v, resolve }));});constm1=mk(1),m2=mk(10);constc=createMemo(()=>m1()+m2());createRoot(()=>createRenderEffect(()=>`${latest(c)}|${isPending(c)}`,()=>{}));flush();awaittask();flush();for(constaofasks.splice(0))a.resolve(a.v);// both answer...setS(2);// ...and are re-asked, same tickawaittask();flush();latest(c);// throws; expected 13
Cause, as review traced it:
asyncWrite flushes synchronously after every landing (schedule(); flush(); in core/async.ts).
The first landing (m1) flushes, and that flush recomputes m2, which the write dirtied, before m2's own reaction runs.
m2's answer then arrives with _inFlight !== result and is dropped.
So whichever source resolves second loses its answer.
This isn't a regression: on next every variant throws, including the one-source case c = m1(). #4459 fixes the one-source case. The two-source case still fails on top of it.
Activity
fix(signals): every answer resolved in the tick a write re-asks it ri…
ryansolid commentedon Oct 30, 2026
Fixed on
nextby #4499 (ef0aadd); it ships in the next RC.Generated by Claude Code
test(signals): pin #4569 — a first load answered while pending by pro…