-
Notifications
You must be signed in to change notification settings - Fork 857
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
[Bug]: Possible race condition when paper in async mode #1831
Comments
Please, don't use Similar to #1320. It's a |
The bug happens with |
|
Ohhh.... I got to the bottom of the bug. Really interesting. The bug was actually being thrown by the This bug aside, I might have to reconsider using the |
Feel free to join this discussion 😃 |
This should be closed as it's an expected behavior (sort of). |
What happened?
I'm hitting a bug in which the paper is trying to sort elements that were recently removed from the graph.
The code in which I think the bug is located:
This is caused by the fact that
$cells
contains the elements that are still in the DOM, whilecells
contains the elements that are in the graph. When the paper is inasync
mode, a race condition might happen in such a way that a given element can be removed from the graph and this function can be triggered before the element has been removed form the DOM.This will lead to the
sortElements
function trying to sort elements that don't exist.Repro example: https://codesandbox.io/s/jointjs-possible-race-condition-embed-remove-link-tofront-pttdim
Proposed solution:
Version
3.5.5
What browsers are you seeing the problem on?
Chrome
What operating system are you seeing the problem on?
Mac
The text was updated successfully, but these errors were encountered: