DYN-7433 Cleanup Node Layout Crash#15495
Merged
QilongTang merged 2 commits intoDynamoDS:masterfrom Sep 23, 2024
Merged
Conversation
When trying to add an Edge was using nodes that doesn't exist in the GraphLayout so it was crashing when trying to access the node coordinates (there is no null validations) so I've added a validation that check if the two nodes exist before trying to create the Edge. I noticed that there is a re-organization layout problem when using the CleanNodeLayout functionality and having a pin inside a group or in the Canvas (seems that the wires and pins are re-organized in a weird way) but I consider that we should create a task for this specific case (just if is a bug, due that pins behave weird when re-organizing).
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-7433
Contributor
Author
Contributor
Author
UI Smoke TestsTest: success. 11 passed, 0 failed. |
QilongTang
reviewed
Sep 23, 2024
| public void AddEdge(Guid startId, Guid endId, double startX, double startY, double endX, double endY) | ||
| { | ||
| //Validates that the two nodes that will be used to create the Edge exist | ||
| if (Nodes.Where(node => node.Id == startId).Count() == 0 || Nodes.Where(node => node.Id == endId).Count() == 0) return; |
Contributor
There was a problem hiding this comment.
Maybe use !Any() instead?
QilongTang
approved these changes
Sep 23, 2024
Contributor
QilongTang
left a comment
There was a problem hiding this comment.
LGTM with one minor comment
Refactoring code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Purpose
Crash when we have a pin inside a group and using the GraphLayout functionality.
When trying to add an Edge was using nodes that doesn't exist in the GraphLayout so it was crashing when trying to access the node coordinates (there is no null validations) so I've added a validation that check if the two nodes exist before trying to create the Edge. I noticed that there is a re-organization layout problem when using the CleanNodeLayout functionality and having a pin inside a group or in the Canvas (seems that the wires and pins are re-organized in a weird way) but I consider that we should create a task for this specific case (just if is a bug, due that pins behave weird when re-organizing).
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Crash when we have a pin inside a group and using the GraphLayout functionality.
Reviewers
@QilongTang
FYIs
@achintyabhat