Repository navigation
fix: a delete that only a backup still holds succeeds and names the backup - #345
Merged
Merged
Conversation
…ackup
DELETE /api/memories/{id} removed and tombstoned the memory and journalled
the erasure outside the backups, then answered 503 "retry" because a backup
snapshot still held a copy. Every retry got the same answer for as long as the
snapshot existed, so a client following Retry-After never saw success.
When backups are the only owner still holding the memory and the restore
journal was written, the delete now succeeds and reports
backup_obligations_pending; a restore replays the journal and removes the
memory again. erasure_verified stays false until the backups are gone, and the
receipt still records them. A journal that could not be written stays a
retryable failure, because a restore would then bring the memory back.
Refs #342
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
When a backup snapshot was taken after a memory was stored,
DELETE /api/memories/{id}removed and tombstoned the memory, journalled the erasure outside the backups, and then answered 503 retry because the snapshot still held a copy. Retrying could never succeed while the snapshot existed (#342).What changes
core/mutations._finalize_erasure: whenbackup_copiesis the only unproven owner, the receipt is persisted and the fact is tombstoned, the erasure counts as done outside the backups. The delete returnsokwithbackup_obligations_pending(number of snapshots).erasure_verifiedstays false until the backups are gone, and the receipt still records the obligation. No change to what is erased.backup_obligations_pending.Safety precondition checked: restore replays the erasure journal (
infra/backup.py→erased_subjects.replay_all, covered bytests/test_infra/test_restore_replays_targeted_erasures.py).Test plan
Refs #342
🤖 Generated with Claude Code