-
Notifications
You must be signed in to change notification settings - Fork 191
Properly check ancestors for alias child #23411
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
Conversation
| @@ -300,7 +300,7 @@ private void attach(Id parentId, Id childId, ChildAttacher attacher) { | |||
|
|
|||
| Id ancestor = resolvedParentId; | |||
| while (ancestor != null) { | |||
| if (ancestor.equals(childId)) { | |||
| if (ancestor.equals(resolvedChildId)) { | |||
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.
non-blocking: could give more context on what is the bigger problem behind this change.
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.
Description added to the top-level PR description. Should just make sure the description is used as the commit message when merging.
|
I generated some conflicts for you |
|



The signal tree logic has a check to verify that a node isn't moved in a way that creates a cyclic graph, i.e. to prevent the node from becoming its own ancestor. Before this fix, the logic was checking based on the provided node id without resolving aliases whereas the actual move was applied with resolved aliases. This made it possible to accidentally move a node in a way that created a cycle by moving an alias of the node rather than the original node. The fix is to resolve any alias before checking for cycles.