Skip to content

Release the storage of messages deleted for good - #8

Merged
markmnl merged 1 commit into
mainfrom
usage-release
Oct 22, 2026
Merged

markmnl merged 1 commit into
mainfrom
usage-release

Conversation

@markmnl

@markmnl markmnl commented Oct 21, 2026

Copy link
Copy Markdown
Owner

An API that deletes a message for good needs to give the storage back to the sender's and recipients' quotas.

  • New POST /fmsgid/send/release and POST /fmsgid/recv/release, with the same AddressTx body and responses as /fmsgid/send and /fmsgid/recv. They record address_tx rows of type 4 (send released) and 3 (recv released).
  • sendSizeTotal and recvSizeTotal now subtract releases, never going below 0. The daily size and count windows still count only sends and receives, so deleting messages can't be used to get round a daily limit.
  • Quota pools work unchanged: releases are per address, like the records.
  • README routes table and the dd.sql type comment are updated. There's no schema change.

Test: TestAddressDetail_Release checks totals go down, the daily usage doesn't, and a release larger than the usage stops at 0. All tests pass against Postgres 17.

🤖 Generated with Claude Code

POST /fmsgid/send/release and /fmsgid/recv/release record types 4 and 3,
which take a size off sendSizeTotal and recvSizeTotal (never below 0) but
not off the daily usage, so deleting messages does not raise a daily limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markmnl
markmnl merged commit 1672779 into main Oct 22, 2026
1 check passed
@markmnl
markmnl deleted the usage-release branch October 22, 2026 02:49
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