Skip to content

Trash: split purge into mark and remove steps - #57

Merged
markmnl merged 1 commit into
mainfrom
purge-steps
Oct 23, 2026
Merged

markmnl merged 1 commit into
mainfrom
purge-steps

Conversation

@markmnl

@markmnl markmnl commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Refactor only, no change in behaviour: purge now calls two steps,

  • markPurged(ctx, identity, ids, threadTop, now): marks ids deleted for good for one address and returns the quota releases;
  • removeUnheld(ctx, ids): removes from the host each id nobody here holds, deepest first, and returns the files to delete after commit.

This lets a caller mark messages purged for several addresses (an owner and its sub-addresses hold each other's messages) before removing anything. It's needed for deleting inactive accounts on fmsg.ai.

Tests: go test ./... with FMSG_TEST_DATABASE_URL (Postgres 17), all pass, including the trash and purge integration tests.

🤖 Generated with Claude Code

markPurged and removeUnheld do the two halves of Delete forever, so other
callers can mark messages purged for several addresses before removing
what nobody holds. No change in behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markmnl
markmnl merged commit 9214a6e into main Oct 23, 2026
1 check passed
@markmnl
markmnl deleted the purge-steps branch October 23, 2026 05:33
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.

1 participant