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

Remove throws from GraphNode which were unnecessarily interrupting execution #4350

Merged
merged 2 commits into from
Jun 22, 2022

Conversation

mvaligursky
Copy link
Contributor

Fixes #4228

Copy link
Contributor

@yaustar yaustar left a comment

Choose a reason for hiding this comment

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

LGTM

this._debugInsertChild(node);
// #endif

this._prepareInsertChild(node);
Copy link
Member

Choose a reason for hiding this comment

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

This function now does node._parent.removeChild(node); where it didn't before.

Might that change behaviour?

(Same for insertChild()).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what is needed to continue with a valid graph. Better solution than throw.

Comment on lines 1218 to 1219
if (node._parent)
node._parent.removeChild(node);
Copy link
Contributor

Choose a reason for hiding this comment

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

If the new behavior is that a node is unparented if it already has a parent, perhaps this should be mentioned in the API ref docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But this triggers a console error, so it's not expected / new behaviour. It's just a mitigation for the app to reasonably continue instead of crash / create invalid graph.

Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason it can't just be documented behavior and not a mitigation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, I agree it's a more expected behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review all throws/exceptions in the graph node class
4 participants