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
Writes that net under a custom equals still pend (D-8) #4483
On next (ab3d2ad), writes count as netted only by identity: a signal's staging counts as netted only when _pendingValue === _value. A signal with a custom comparator can net back to a value the comparator calls equal to the committed one, and that staging still counts as a proposal. The memo over it goes pending. D-8 says writes that net to the committed value make no proposal.
constone={k: 1};const[s,setS]=createSignal(one,{equals: (a,b)=>a.k===b.k});constm0=createMemo(()=>{constv=s().k+1;if(v%4===2)thrownewError(`m0:${v}`);returnv;});createRenderEffect(()=>isPending(m0),v=>seen.push(v));flush();constact=action(function*(){setS({k: 1});// equal to the committed value by the comparator, not by identityyieldnewPromise(()=>{});});setS({k: 2});act();// await a task, then flush// seen: [false, true] expected: [false]
Writing back the committed object itself (setS(one)) nets, and seen stays [false].
One possible fix: at write time, when the comparator says the new staging equals the committed value, store the committed object as the staging. The existing identity test then sees the writes as netted.
Activity
fix(signals): net staged rewrites a custom equals calls equal to the …
ryansolid commentedon Oct 30, 2026
Fixed on
nextby #4488 (6af149e); it ships in the next RC.Generated by Claude Code