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
"Append at end" reads max sibling order and treats last_order > 0.0 as "siblings exist", else returns order 1.0 (sqlite_store.rs:486-490, 3074-3078, 3127-3134). But fractional ordering legitimately yields orders ≤ 0 (prepends → 0.0, -1.0…), and unwrap_or(0.0) maps NULL to 0.0. A lone child at order 0.0 is misread as "no children" → next append also gets 1.0 → two siblings share order 1.0.
Fix: distinguish "no row" from "row with order ≤ 0" (Option/row-count); pass Some(last_order) whenever any row exists, regardless of sign.
Found via the 2026-06-18 multi-repo bug-hunt sweep. Confidence/severity from the sweep + spot-verification.
Resolved in #1458. The three append-order sites now track sibling presence as Option<f64> instead of the last_order > 0.0 sentinel, so an append computes from the real max sibling even when its order is ≤ 0 (a legitimate prepend result) — no more first-item-default collisions. Test: append after a sibling at -1.0 → 0.0, not 1.0.
Activity
mstomar125 commentedon Jun 24, 2026
Resolved in #1458. The three append-order sites now track sibling presence as
Option<f64>instead of thelast_order > 0.0sentinel, so an append computes from the real max sibling even when its order is ≤ 0 (a legitimate prepend result) — no more first-item-default collisions. Test: append after a sibling at -1.0 → 0.0, not 1.0.