-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dispatch overridden w/ side effects when child emits new program event. #365
Comments
@DnMllr we were discussing on slack last week? |
@DnMllr Can you comment? |
This is correct. The Dispatch doesn't handle this case correctly (emitting events while other events are being processed). Sorry that is took that long. I made a quick fix for this. The problem basically is that the queue in Dispatch is being for multiple events. I changed it so it now creates a new one. |
Any update on when this fix will be mainlined? |
If a change is going to be made, I think it needs to also address:
However, from a pure technical standpoint, everything looks good. And of course, this PR may not be the place for such a change. |
@jd-carroll the first point is covered here: #366. |
This issue can be closed as a fix has been landed |
If an event (event alpha) is currently being processed (i.e. the Breath First Search is ongoing) for a particular program event via Dispatch, and a child node's (node X) handling of this event creates a new program event (event beta) targeted at the path of its own node, then this event will 'take over' the event Dispatch, but keep the remaining children in the queue. This results in event beta being sent to the neighbours of node X and not simply its children.
The following JSBin demonstrates this problem: https://jsbin.com/toroqaheze/edit (needs local images, but effect can still be seen).
To reproduce:
1,2,3,4 will change the speed of spinning of each child, but 3 will emit a new event (.hide()) as well, this overrides the currently processed event (speedChange) and the 4th node's speed is not changed.
Gist is here: https://gist.github.com/anonymous/e9f45883faad8540ff66
The text was updated successfully, but these errors were encountered: