Skip to content

fix: expire purge tombstones after a TTL so re-created notes survive (#127) - #136

Merged
CryptoJones merged 1 commit into
mainfrom
fix/127-tombstone-ttl
Jul 1, 2026
Merged

fix: expire purge tombstones after a TTL so re-created notes survive (#127)#136
CryptoJones merged 1 commit into
mainfrom
fix/127-tombstone-ttl

Conversation

@CryptoJones

Copy link
Copy Markdown
Owner

Closes #127.

.omi-tombstones was append-only and never expired; _apply_tombstones unlinked any matching top-level note on every sync — so re-creating a note with a previously-purged filename (months later) got it deleted fleet-wide with no signal.

New tombstones now carry an ISO-8601 timestamp and stop deleting after TOMBSTONE_TTL_DAYS (90). Expiry is decided by the per-line timestamp, so every node converges on the same result under the merge=union driver (a locally-removed line would just be re-added by a lagging peer). Expired lines are GC'd to bound the file. Legacy undated tombstones stay permanent — they can't be safely dated under union-merge.

Test plan

  • New tests: expired tombstone doesn't delete a re-created note + is GC'd; a within-TTL tombstone still deletes; a legacy bare tombstone stays permanent.
  • Full suite: 720 passed, 1 skipped. ruff + mypy clean.

🤖 Generated with Claude Code

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

…127)

.omi-tombstones was append-only and never expired, and _apply_tombstones
unlinked any matching top-level note on every sync — so re-creating a note with
a previously-purged filename got it deleted fleet-wide with no signal. New
tombstones now carry an ISO timestamp and stop deleting after TOMBSTONE_TTL_DAYS
(90); expiry is by the per-line timestamp so every node converges under the
union merge, and expired lines are GC'd to bound the file. Legacy undated
tombstones stay permanent (they can't be safely dated under merge=union).

Closes #127.

Co-Authored-By: Claude Fable 5 <[email protected]>
@CryptoJones
CryptoJones merged commit 04bc957 into main Jul 1, 2026
10 checks passed
@CryptoJones
CryptoJones deleted the fix/127-tombstone-ttl branch July 1, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mesh: expire / GC tombstones so a re-created note is not silently deleted

1 participant