-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Inserting gateway fails with Cannot read properties of undefined (reading 'segmentIndex')
#1541
Comments
I was able to root-cause this issue. The Conditions for this to happen are:
We effectively don't have an intersection with the connection, because all points of the connection are inside the shape bounding box. This is missed in our error protection: bpmn-js/lib/features/modeling/behavior/DropOnFlowBehavior.js Lines 54 to 69 in 82a250b
We then have a connection with only 1 Waypoint that breaks later when we try to calculate intersections on the line, which fails. The behavior seems broken even when no label is present: I see 2 options to solve this issue: 1️⃣ Don't handle this edge case as an "drop on flow" and don't connect it to the flow. 2️⃣ Always add a second waypoint to the new connection, e.g. the nearest shape border. I gravitate strongly to 1️⃣. This would change the requirement for "drop on flow" to "the complete shape is on the flow". Currently only the mid-point is considered, which I don't find intuitive. |
Is 1️⃣ hard to accomplish? I'd love to see it in action to get a feeling for it. |
Should be easy enough, I'll create a branch tomorrow |
After giving it another thought, I'd go with option 2️⃣. #1542 outlines the rationale. |
I tried it out and agree. 2️⃣ feels "right" |
Describe the Bug
When dropping a gateway onto a flow the editor may blow up with the following error:
Attached a screen capture of the interaction:
Steps to Reproduce
Expected Behavior
Environment
Reported via forum.
Tracked via crash reporting, too.
The text was updated successfully, but these errors were encountered: