Repository navigation
feat(sites): soft delete with configurable retention and restore - #256
Merged
Merged
Conversation
This was referenced Oct 9, 2026
Deleting a site now keeps its content for sites.cleanup.deletedRetentionDays
(default 30) before the cleanup job purges it. Owners can list their
restorable sites (view=deleted) and restore one at the same id and URL via
POST /api/v2/sites/{siteId}/restore or the restore_site MCP tool.
vigneshrajsb
force-pushed
the
site-soft-delete
branch
from
October 9, 2026 17:46
4397c11 to
6fef0be
Compare
vigneshrajsb
marked this pull request as ready for review
October 9, 2026 19:55
vmelikyan
approved these changes
Oct 9, 2026
… cleanup Restoring a site whose expiry had passed while TTL is off now clears the expiry, so the next cleanup run cannot expire and purge it. When the cleanup job is disabled, delete purges at once as before, since nothing would purge it later. Retention 0 reports no restore window.
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.
Description
Builds on #254 (merged).
Soft delete: deleting a site still takes it offline immediately, but its content is now kept for
sites.cleanup.deletedRetentionDays(default 30; 0 purges on the next cleanup run) instead of being purged at once.Restore: owners can restore a deleted site at the same id and URL with
POST /api/v2/sites/{siteId}/restoreor the newrestore_siteMCP tool. A restore needs the currentexpectedAccessRevision, and a site whose expiry has passed gets a fresh TTL.Finding deleted sites:
GET /api/v2/sites?view=deletedandlist_siteswithdeleted: truereturn the caller's restorable sites. Site responses gaindeletedAt,restorableUntilandpermissions.canRestore.Purge: the existing sites cleanup job moves deleted sites past the retention window to a terminal
purgedstatus in a single conditional update, then removes their storage. A concurrent restore holds the row lock, so a site can't be both restored and purged.Sites already deleted before this change had their content purged at the time, so they can't be restored and are left out of the deleted view.
MCP catalog size: the new site tool outputs use a smaller schema to stay under the 64 KiB catalog cap. The catalog is now 65,247 bytes, so the next new tool will need the cap raised or other tools trimmed.
Behaviour notes:
deletedRetentionDaysapplies to sites that are already deleted at the next cleanup run: lowering it purges older ones, and raising it can't bring back sites that are already purged.Capabilities now include
deletedRetentionDays, so clients can show the retention period.Test plan
view=deleted, restore it, and check the same link works again.purgedand can no longer be restored.delete_site, thenlist_siteswithdeleted: true, thenrestore_site.