Trash: delete with restore, 30-day auto-empty #90

Closed
opened 2026-10-13 22:34:01 +00:00 by kayg · 1 comment
Owner

N5: deleting a note moves it to Trash with restore; Trash auto-empties after 30 days. Today Delete is disabled ("Coming with Trash").

  • notes.delete {id} moves the file to a per-user Trash area (not inside Notes/), keeps its id, history and backlinks info; one journaled op, undoable (toast with Undo via the shared toast adapter).
  • notes.restore {id} puts it back at its path (collision → " 2").
  • notes.trash {cursor?} lists trashed notes; notes.empty-trash and the 30-day auto-empty as a yielding background job (never blocks anyone).
  • Links pointing to a trashed note are left as written (they become "missing" in the UI) and come back alive on restore.
  • Search and lists exclude trashed notes; Trash is a sidebar entry and a Settings section.
  • Tests: delete/undo/restore, collision on restore, outside deletion of the file (watcher) treated as trash, kill -9 mid delete, auto-empty boundary.
N5: deleting a note moves it to Trash with restore; Trash auto-empties after 30 days. Today Delete is disabled ("Coming with Trash"). - `notes.delete {id}` moves the file to a per-user Trash area (not inside Notes/), keeps its id, history and backlinks info; one journaled op, undoable (toast with Undo via the shared toast adapter). - `notes.restore {id}` puts it back at its path (collision → " 2"). - `notes.trash {cursor?}` lists trashed notes; `notes.empty-trash` and the 30-day auto-empty as a yielding background job (never blocks anyone). - Links pointing to a trashed note are left as written (they become "missing" in the UI) and come back alive on restore. - Search and lists exclude trashed notes; Trash is a sidebar entry and a Settings section. - Tests: delete/undo/restore, collision on restore, outside deletion of the file (watcher) treated as trash, kill -9 mid delete, auto-empty boundary.
Author
Owner

PR is up: #98 (branch issue/90-trash, commits a84bdd4 server, c1573cb web). Screenshots are on the PR.

Done:

  • delete/restore as undoable jobs
  • the Trash list (paged)
  • Delete forever and Empty, confirmed in place
  • the 30-day hourly sweep
  • outside deletes go to the Trash
  • links to trashed notes show as missing
  • live updates
  • the Rust tests listed in the issue, plus Playwright in Chromium and WebKit

Not met: delete p95 < 50 ms on the perf VM (113–150 ms). That disk takes ~8–15 ms per fsync and a delete needs four in a row. On the dev box p95 is ~2 ms. Restore p95 on the perf VM is 37–55 ms. Getting delete under budget needs a decision on the shared job framework: answer before the job's "done" write is flushed. Details are in the PR.

PR is up: #98 (branch `issue/90-trash`, commits a84bdd4 server, c1573cb web). Screenshots are on the PR. **Done:** - delete/restore as undoable jobs - the Trash list (paged) - Delete forever and Empty, confirmed in place - the 30-day hourly sweep - outside deletes go to the Trash - links to trashed notes show as missing - live updates - the Rust tests listed in the issue, plus Playwright in Chromium and WebKit **Not met:** delete p95 < 50 ms on the perf VM (113–150 ms). That disk takes ~8–15 ms per fsync and a delete needs four in a row. On the dev box p95 is ~2 ms. Restore p95 on the perf VM is 37–55 ms. Getting delete under budget needs a decision on the shared job framework: answer before the job's "done" write is flushed. Details are in the PR.
kayg closed this issue 2026-10-14 04:31:16 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#90
No description provided.