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
If you create an S.value and update it multiple times before attaching any listeners, the Value erroneously reports conflicting values.
varfoo=S.value(100);foo(200);// Succeedsfoo(300);// Error: conflicting values: 300 is not the same as 200
I believe this happens, because on line 267 the DataNode does not cause to RootClock to tick if it has no listeners. So S.value's age is equal to the RootClock.time causing the fault.
A fix would be to preserve the age of the S.value when RunningClock == null and no listeners.
if(arguments.length===0){returnnode.current();}elseif(RunningClock===null&&node.log===null){returncurrent=node.next(update!);}else{varsame=eq ? eq(current,update!) : current===update;if(!same){vartime=RootClock.time;if(age===time)thrownewError("conflicting values: "+update+" is not the same as "+current);age=time;current=update!;node.next(update!);}returnupdate!;}
The text was updated successfully, but these errors were encountered:
This is also hotfixed by always setting this.log = new Log() in the DataNode constructor. It looks like an optimization to reduce memory usage (❤️ always appreciated) by not allocating a new Log object for all data signals that may not be used in computations, but that gets bugged when no computations actually use the value.
@adamhaile any chance of getting a fix for this? :)
If you create an
S.value
and update it multiple times before attaching any listeners, the Value erroneously reports conflicting values.I believe this happens, because on line 267 the
DataNode
does not cause toRootClock
to tick if it has no listeners. So S.value'sage
is equal to theRootClock.time
causing the fault.A fix would be to preserve the
age
of theS.value
whenRunningClock == null
and no listeners.The text was updated successfully, but these errors were encountered: