-
Notifications
You must be signed in to change notification settings - Fork 419
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
FIx undo/redo for collapsed subprocesses #957
base: develop
Are you sure you want to change the base?
Conversation
Do you have a branch with an integration test for bpmn-js? Let's verify that this PR fixes the issue when linked with bpmn-js. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests (in diagram-js too) which reproduce the issue and allow us to verify the fix.
I extended the integration tests in bpmn-js with one that covers this bug. Failing with current version, passes with the change: bpmn-io/bpmn-js@5d8240d |
@@ -192,6 +192,11 @@ GraphicsFactory.prototype.updateContainments = function(elements) { | |||
forEach(children.slice().reverse(), function(child) { | |||
var childGfx = elementRegistry.getGraphics(child); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I struggle to understand in which situation this can become an issue, could you elaborate? And would you be able to model this as a test case in diagram-js?
From what I understand:
GraphicsFactory#updateContainment
is being called after any change operation happened (ref)- At this stage, looking at the model, parents for updated children are collected
- Then the children inside these parents are re-ordered
- BUT some of the children are actually NOT part of the render tree anymore?
The BUT is the big issue for me. How can children exist, but not actually be rendered? Where don't we properly update the model before we render?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may also be that we messed up the bpmn-js implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jarekdanielak Let's figure out if we fixed the root cause of the issue here, happy to help with a debug session / code review.
Proposed Changes
Related to bpmn-io/bpmn-js#2269
Add some null checks to prevent crashes when undo/redo adds or removes a collapsed subprocess.
Checklist
To ensure you provided everything we need to look at your PR:
@bpmn-io/sr
toolCloses {LINK_TO_ISSUE}
orRelated to {LINK_TO_ISSUE}