Skip to content

Deleted CRDT-tracked files reappear on every reconcile because tombstones never reap #78

Description

@stephangrobler

YAOS plugin version

2.1.1

Server deployment commit SHA

Unknown, server deployed via Cloudflare Worker at .workers.dev

Relevant logs or error text

logs/2026-09-18/boot-nWCiZqQ0XydRK6.ndjson, ~13:16:47Z, after the files below had already been deleted (deletion confirmed committed to the vault's git history):

flushWrite: "2 Areas/Logs/Events/Foodies at Janine and Rickus - 2023-06 (YAOS conflict - crdt from stephan-home-pc 2026-08-23T23-50-39Z).md" unchanged, skipping
flushWrite: "2 Areas/Logs/Daily Journal/2026-08-17 (YAOS conflict - crdt from stephan-home-pc 2026-08-23T23-50-39Z).md" unchanged, skipping
flushWrite: "2 Areas/Logs/Daily Journal/2026-08-04 (YAOS conflict - crdt from stephan-home-pc 2026-08-23T23-50-39Z).md" unchanged, skipping

(14 files total in this batch, all previously deleted, all rewritten.)

serverTrace snapshots, taken roughly every 15 seconds over several hours:

{
  "event": "tombstone-reap",
  "metaEntries": 6112-6126,
  "tombstones": 1154,
  "alreadyReaped": 0,
  "withBody": 1154,
  "reaped": 0,
  "withinGrace": 1154,
  "unknownAge": 0,
  "conflicted": 0,
  "remaining": 0
}

reaped is 0 and withinGrace equals the full tombstone count in every snapshot across the session. tombstonedPathCount in client state stays fixed at 1154 across multiple reconciles and restarts, independent of what got deleted or resynced in that window.

Live check against this room's own diagnostic endpoints today (/vault/:id/snapshots/status, /vault/:id/snapshots, /vault/:id/debug/recent) all return HTTP 200, so the Durable Object is not wedged the way it was in #73. But the latest snapshot response includes:

"markdownFileCount": 0

despite the room tracking roughly 4,972 markdown paths. That's the same unexplained anomaly noted at the end of #73 ("every snapshot lists md:0 even though the room holds 217 markdown files that sync fine") after that room's full worker-delete-and-reseed recovery. Different room, same symptom.

What you did

  1. Delete a tracked markdown file. Reproduced via a raw filesystem move and via Obsidian's own delete UI, with the same result either way.
  2. Restart Obsidian, or wait for the next authoritative reconcile.
  3. flushWrite recreates the file on disk with its original content and path, because the CRDT still holds it as live: tombstones for this room appear to never leave their grace period and finalize.

One file in the same batch has corrupted YAML frontmatter, including literal unresolved git merge markers in the body, and does not reappear silently. The frontmatter safety guard catches its flushWrite and blocks it (yaml-parse-error), surfacing a user notice. flushWrite itself works correctly; the defect looks isolated to tombstone finalization.

Deletion is non-durable for the life of this bug: duplicate and junk files cannot be permanently removed, they return on every restart.

Related issues

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions