Skip to content

Feature/soft delete trash - #123

Open
ParnianHajian wants to merge 9 commits into
mainfrom
feature/soft-delete-trash
Open

Feature/soft delete trash#123
ParnianHajian wants to merge 9 commits into
mainfrom
feature/soft-delete-trash

Conversation

@ParnianHajian

Copy link
Copy Markdown
Contributor

Recycle bin for the file explorer

Soft delete instead of hard delete. Deleting a file now moves it into trash/ at the pod root instead of nuking it; you can restore it back to its exact original location (ACL and all), permanently delete it, or just leave it and it'll get cleaned up automatically after 30 days.

What's included

Soft delete moves a file's payload and metadata into trash/<uuid>/, snapshots its ACL verbatim, writes an Activity-Streams tombstone recording when it was deleted, where it came from, and when it expires, then revokes the original. Restore puts it back at its exact original URI with the ACL restored from that snapshot, and just refuses if something's already occupying that spot rather than clobbering it. Permanent delete works one row at a time or all at once through "Empty recycle bin." Anything past its 30-day retention window gets purged the moment the bin is opened, so there's no server-side scheduler involved.

New infrastructure

Layer Modules
Solid primitives trashPaths, tombstone, resourceCopy, containerListing
WAC/ACL aclSnapshot (verbatim ACL capture/restore), wacAllow (permission check)
Services softDeleteFile, restoreTrashedFile, deleteResource (updated), fileFilter (updated)
Hooks useTrashEntries, useGuardedSoftDelete
UI TrashView / TrashTable, wired into NavRail, SelectionActions, FileCard

Also included is a schema.org vocabulary migration (eeb064e) that replaces the project's old custom w3id.org/solid-drive# file-type vocabulary with real schema.org terms. It's unrelated to the trash feature but was already sitting on this branch, so I kept it as its own commit in case you'd rather it land separately.

Test plan

  • npm run test:coverage passes
  • malformed tombstone/ACL snapshot. All files ≥80% branches/lines/functions/statements.
  • npm run test:e2e -- e2e/tests/trash.spec.ts passes (7 scenarios against a real CSS instance):
    • Restore returns a shared file to its original location and the restored ACL matches the original byte-for-byte
    • Restore refuses to overwrite when something now occupies the original location; trash copy and the new file are both left intact
    • Restore succeeds for a file with no ACL of its own and doesn't create one
    • Permanent delete removes both the catalog row and the physical trash container
    • "Empty recycle bin" does the same for multiple items at once
    • An expired item is purged the moment the bin is opened
    • A non-expired item survives that same cleanup pass
  • npm run test:e2e full suite pass
  • Manual: upload a file, select it, "Move to bin," open the recycle bin from the nav rail, restore it, confirm it's back in the same folder
  • Manual: permanently delete a file and confirm it's actually gone from the pod, not just the UI

@ParnianHajian
ParnianHajian requested a review from anbo-de August 12, 2026 08:10
@ParnianHajian ParnianHajian self-assigned this Aug 12, 2026
@ParnianHajian ParnianHajian added the enhancement New feature or request label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant