Skip to content
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

DYN-7433 Cleanup Node Layout Crash #15495

Merged

Conversation

RobertGlobant20
Copy link
Contributor

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

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

Crash when we have a pin inside a group and using the GraphLayout functionality.

Reviewers

@QilongTang

FYIs

@achintyabhat

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).
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-7433

@RobertGlobant20
Copy link
Contributor Author

This is a GIF showing the behavior BEFORE my fix (crashing)
DynamoSandbox_6a0Tg7kRCr

@RobertGlobant20
Copy link
Contributor Author

This is the behavior after my fix (no crash)
OEBIncK4RQ

Copy link

github-actions bot commented Sep 20, 2024

UI Smoke Tests

Test: success. 11 passed, 0 failed.
TestComplete Test Result
Workflow Run: UI Smoke Tests
Check: UI Smoke Tests

@QilongTang QilongTang added this to the 3.4 milestone Sep 23, 2024
@@ -108,6 +108,9 @@ public void AddNode(Guid guid, double width, double height, double x, double y,
/// <param name="endY">The y coordinate of the connector's right end point.</param>
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use !Any() instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated in the next commit: 0f97fe1

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one minor comment

@QilongTang QilongTang merged commit 6b4572e into DynamoDS:master Sep 23, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants