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
{{ message }}
Repository navigation
[bug] Cross-parent move_node is non-transactional — a mid-op failure orphans the node #1429
Moving to a different parent (sqlite_store.rs:1559-1571) runs two separate db.execute calls with no enclosing transaction: DELETE the old has_child edge, then INSERT the new one. If the INSERT fails (constraint/IO/crash/cancel) the DELETE is already committed → node left with nohas_child edge (silently orphaned root). Sibling functions move_children_to_parent and delete_subtree_atomic correctly wrap their multi-statement mutations in a transaction; this path does not.
Fix: wrap delete-old + insert-new (and the make-root delete) in one tx + commit().
Found via the 2026-06-18 multi-repo bug-hunt sweep. Confidence/severity from the sweep + spot-verification.
Resolved in #1453 (Batch A). Wrapped the cross-parent delete-old + insert-new has_child edges in one transaction() + commit() so a mid-op INSERT failure can no longer leave the node orphaned (no parent edge). Make-root / same-parent-reorder are single statements, already atomic. New test test_move_node_cross_parent_leaves_exactly_one_edge; cargo fmt + clippy -D warnings clean.
Activity
mstomar125 commentedon Jun 24, 2026
Resolved in #1453 (Batch A). Wrapped the cross-parent delete-old + insert-new
has_childedges in onetransaction()+commit()so a mid-op INSERT failure can no longer leave the node orphaned (no parent edge). Make-root / same-parent-reorder are single statements, already atomic. New testtest_move_node_cross_parent_leaves_exactly_one_edge; cargo fmt + clippy -D warnings clean.