stavalfi / jstream

Represent graphs, differently https://stavalfi.github.io/jstream/
2 stars 0 forks source link

Bug while duplicating graph when updating shared node. #13

Closed stavalfi closed 5 years ago

stavalfi commented 5 years ago

There is a bug in this function: duplicateWorkflowGraph: https://github.com/stavalfi/workflow/blob/46deaccb53fc607bf43fb5ee1eef35f3297e6663/src/createReducer.js#L174

The bug is: if {a,b} -> c , then the result is: a'->c' , b'->c'' .

stavalfi commented 5 years ago

Solution: Migrate to immutable to represent the state tree (and the graphs in it)

stavalfi commented 5 years ago

Immutable.js doesn't solve this issue: https://github.com/facebook/immutable-js/issues/1023

Immutable.js doesn't support updating a shared object in the state tree by updating all its parents.