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 / next] A guess on a second createOptimistic made while another action's refresh is in flight doesn't show (#4629, other source) #4666
This is #4629's shape, but the second guess goes into a different createOptimistic. #4637 fixed the case where both guesses go into the same log; that case passes here. With a second log, the guess is held: it doesn't show while its own action is out. It is still hidden after that action is accepted, and appears only once every refresh has landed.
constserver=createMemo(()=>ask("fetch").then(()=>serverRows.map(r=>({ ...r}))));const[assignTruth]=createSignal(()=>[]asnumber[]);const[assigning,guessAssign]=createOptimistic(()=>assignTruth());const[closeTruth]=createSignal(()=>[]asnumber[]);const[closing,guessClose]=createOptimistic(()=>closeTruth());constshown=createMemo(()=>server().filter(r=>!closing().includes(r.id)).map(r=>`#${r.id}(${assigning().includes(r.id) ? "guest" : r.who??"-"})`).join(" "));createRenderEffect(()=>shown(),v=>frames.push(v));constassign=action(function*(id){guessAssign(xs=>[...xs,id]);yieldask(`assign:${id}`);/* server updates */refresh(server);});constclose=action(function*(id){guessClose(xs=>[...xs,id]);yieldask(`close:${id}`);/* server updates */refresh(server);});
Steps: land fetch with rows #1 and #3. Call assign(3) and land assign:3; its refresh(server) is now in flight. Then call close(3).
The same steps with the close guess written into assigning (same log) show #1(-) at once.
How we found it: it is the most common remaining fuzzer hole in AI-written ReactiveScript apps on our eval's issue desk. Seed 5, "closed row shown", appears in 4 of 12 apps on b656418. Those apps keep one guess log per action kind over a refreshed list.
Activity
fix(signals): a guess into a log whose lane has shown is not held by …
fix(signals): a guess into a second optimistic log shows beside anoth…