Closed dashed closed 9 years ago
@Dashed : This is fixed, no?
@mikaelbr I just glanced at master. It isn't fixed yet.
To elaborate, the issue is that when stale cursors update, then assert(emitter.current !== oldRoot)
. oldRoot
should be ignored; and it's incorrect behaviour to be passing that as "previous state" to any observers.
emitter.current
should be the "previous state".
I've been busy with other stuff and I haven't been able to get around to PR'ing or working on immstruct/cursor stuff. The fix is easy, but just a test case for it.
I don't rely on this feature, so this bug is low priority.
Did you have a failing test-case for this?
@mikaelbr don't have an exact test in mind. But I think one can create a stale cursor, and update it to see that emitter.current
isn't being passed to listeners.
handleSwap
andhandlePersisting
incorrectly use previous stateThis is bad when a stale cursor updates, and a stale "previous" state (e.g
oldData
) is passed instead of the actual previous state.I'll eventually PR.
Can be fixed by doing something like this: