Skip to content

[bug] Version-conflict reports actual_version: 0 when the node was concurrently deleted (should be NotFound) #1432

Closed

Description

@mstomar125

Severity: medium · Confidence: high

update_node_with_version_check returns Ok(None) for both a version mismatch and a missing row (crud.rs:990-1004, sqlite_store.rs:779-781). The caller maps None→version_conflict; when the node is gone the re-fetch None→unwrap_or(0) → VersionConflict{actual:0} instead of NotFound. For date-format IDs the re-fetch returns a virtual node with version:1 → false actual:1. Retry-on-conflict clients loop/mishandle.

Fix: on rows_affected==0, re-check existence: absent → node_not_found; present → version_conflict with the real version.


Found via the 2026-06-18 multi-repo bug-hunt sweep. Confidence/severity from the sweep + spot-verification.

Activity

  1. mstomar125 commented on Jun 24, 2026

    @mstomar125
    ContributorAuthor

    Resolved in #1458. New persisted_version reads the real node row (no date-page virtualization); update_node uses it on a no-op version-checked UPDATE — missing row → node_not_found, present → version_conflict with the REAL version (no more actual:0/phantom actual:1). Test covers missing (incl. date id) vs present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions