You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scope: node_mut.reparent_from_id_append(...) Observation: reparented child that contains own children retains the link to the old parent. Expected: all reparented children get "parent" link updated to the new parent regardless of whether they have own children. Library version: ego-tree = "0.10.0"
I'm writing an algorithm that is merging the contents of the multiple consequent matching siblings into one node. In order to transfer children from one node to another node I'm calling reparent_from_id_append() on the future parent and passing sibling's id as an argument.
Example.
Tree before merging:
Heading2 (NodeId(7))
Text (NodeId(8)): "Self-Managed Cyprus\n\t\t\t\t\t\t\t\t\t\t\tLTD"
Heading2 (NodeId(9))
Text (NodeId(10)): "from "
Bold (NodeId(11))
Text (NodeId(12)): "€ 1070"
Text (NodeId(13)): "\n\t\t\t\t\t\t\t\t\t\t\tplus VAT"
Heading2 (NodeId(14))
Link (NodeId(15))
Text (NodeId(16)): "Order now"
Expected tree after merging:
Heading2 (NodeId(7))
Text (NodeId(8)): "Self-Managed Cyprus\n\t\t\t\t\t\t\t\t\t\t\tLTD"
Text (NodeId(10)): "from "
Bold (NodeId(11))
Text (NodeId(12)): "€ 1070"
Text (NodeId(13)): "\n\t\t\t\t\t\t\t\t\t\t\tplus VAT"
Link (NodeId(15))
Text (NodeId(16)): "Order now"
In this example I'm having issue with Node 11: it is retaining a reference to the old parent Node 9 while it should be pointing at a new parent Node 7. I verified that by migrated_child.ancestors() method and migrated_child.parent.
It does not seem like an intended behavior because Node 7 starts having Node 11 among its children (as expected) but Node 11 doesn't seem to know about it and still remembers old parent Node 9 (not expected).
Could anyone from maintainers please provide some information on this issue I'm having?
The text was updated successfully, but these errors were encountered:
Using "append_id()" directly for every migrating child of the merged node works well, library updates references to parents well.
So I'm suspecting the issue is really with "reparent_from_id_append()". I only found one test case of reparent_from_id_append in the library and, if Im not mistaken, it does not seem to include the situation I'm describing.
Scope: node_mut.reparent_from_id_append(...)
Observation: reparented child that contains own children retains the link to the old parent.
Expected: all reparented children get "parent" link updated to the new parent regardless of whether they have own children.
Library version: ego-tree = "0.10.0"
I'm writing an algorithm that is merging the contents of the multiple consequent matching siblings into one node. In order to transfer children from one node to another node I'm calling reparent_from_id_append() on the future parent and passing sibling's id as an argument.
Example.
Tree before merging:
Expected tree after merging:
In this example I'm having issue with Node 11: it is retaining a reference to the old parent Node 9 while it should be pointing at a new parent Node 7. I verified that by migrated_child.ancestors() method and migrated_child.parent.
It does not seem like an intended behavior because Node 7 starts having Node 11 among its children (as expected) but Node 11 doesn't seem to know about it and still remembers old parent Node 9 (not expected).
Could anyone from maintainers please provide some information on this issue I'm having?
The text was updated successfully, but these errors were encountered: