Repository navigation
Batch C (P2): append-order sentinel (#1431) + conflict-vs-NotFound (#1432) + foreign-write signal (#1437) - #1458
Conversation
|
APPROVE Reviewed all three bundled P2 fixes against the head ref ( #1431 — append-order sentinel. Real root cause: the old #1432 — version_conflict{actual:0} vs NotFound. #1437 — silent foreign-write. New Community-build mandate: all additive correctness/UX in shared core + frontend, no Pro/sync coupling; consistent with Nits (non-blocking):
|
…closes #1431, closes #1432, closes #1437) Three P2 core edge-case fixes. exist", but fractional ordering legitimately yields orders <= 0 (a prepend gives 0.0, then -1.0…). A lone sibling at <= 0 was misread as "no siblings", so the append fell back to the first-item default instead of computing from the real max → sibling-order collisions. Track presence as Option<f64> at all three append sites; append after the max regardless of sign. `version_conflict{actual:0}` for BOTH a version mismatch and a concurrent delete, because it re-read the version via `get_node` (which virtualizes a date page → phantom version 1). Add `persisted_version` (real row, no virtualization) and use it: missing → `node_not_found`; present → `version_conflict` with the real version. protect the optimistic text) with NO signal, relying on a later OCC that may never fire if the local version was already synced — the user keeps typing over a stale base unaware. Raise a deduped `version-mismatch` conflict notification in the not-own-echo branch. Tests: negative-order append; persisted_version missing-vs-present (incl. date id); foreign-write notifies / own-echo doesn't / dedupes. Core 959 + frontend 3888 green; free-users 7/7. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Summary
Phase 1 bug-sweep Batch C (P2), core edge cases — three independent fixes.
#1431— append-order sentinel misreads orders ≤ 0"Append at end" treated
last_order > 0.0as "siblings exist", but fractional ordering legitimately yields orders ≤ 0 (a prepend → 0.0, then -1.0…). A lone sibling at ≤ 0 was misread as "no siblings", so the append used the first-item default instead of computing from the real max → sibling-order collisions.Fix: track presence as
Option<f64>at all three append sites; append after the max regardless of sign.#1432—version_conflict{actual:0}instead ofNotFoundon concurrent deleteupdate_nodemapped a no-op version-checked UPDATE toversion_conflict{actual:0}for both a version mismatch and a concurrent delete, re-reading the version viaget_node(which virtualizes a date page → phantom version 1).Fix: new
persisted_version(real row, no virtualization) — missing →node_not_found; present →version_conflictwith the real version.#1437— foreign write to a focused node was silently droppedA foreign
databasebroadcast for an actively-edited node was skipped (to protect optimistic text) with no signal, relying on a later OCC that may never fire — the user keeps typing over a stale base, unaware.Fix: raise a deduped
version-mismatchconflict notification in the not-own-echo branch.Tests
persisted_versionmissing-vs-present (incl. date id); foreign-write notifies / own-echo doesn't / dedupes.clippy -D warnings/fmt/eslint clean;test:free-users7/7.Free/community impact
Community-build fixes (core + frontend) — additive correctness/UX, no Pro coupling; free-users green.
Closes #1431, closes #1432, closes #1437.