Repository navigation
Conversation
Each identity gets a trash. DELETE /fmsg/:id on a sent message moves it (or with ?thread=true its whole thread, later replies included) into the caller's trash; POST /fmsg/:id/restore takes it out; ?permanent=true deletes it for good. Lists leave trashed messages out unless ?trash=include or only, and every message carries its trash state. A message deleted for good, and everything replying to it, is 404 on every route for that identity, never listed, pushed or sent over the WebSocket, and its usage is released to fmsgid. Once no local participant holds it and no delivery is pending, it is removed from the host, so fmsgd rejects replies to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Lets a user get rid of sent and received messages. Each identity has its own trash; nothing in it changes what anyone else sees.
Depends on markmnl/fmsgd#51 (a transaction may purge a sent message) and markmnl/fmsgid#8 (usage release). CI loads fmsgd's
dd.sqlfrom the pinned module, so once fmsgd#51 is merged I'll bump thegithub.com/markmnl/fmsgdversion ingo.modon this branch. Until thenTestPurgefails in CI. It passes locally against the fmsgd branch.API
DELETE /fmsg/:idon a sent message (sender or recipient): moves it into the caller's trash.?thread=truedeletes the whole thread below it, including replies that arrive later.?permanent=truedeletes it for good: the message and everything below it, or the whole thread withthread=true.POST /fmsg/:id/restore(?thread=true): takes it out of the trash.GET /fmsg,GET /fmsg/sent:?trash=exclude(the default, so existing clients and agents see no deleted mail),includeoronly. Every message (list, get, WebSocket, thread messages) carries"trash": null | "message" | "thread".trashevent{id, trash: "purged"}.400 parent message not found.pidset to NULL. fmsgd then rejects replies to it as parent not found.trashWebSocket event (viapg_notify('msg_trash')), so other tabs and devices update.Schema (
dd.sql)fmsg_api_trash (addr, msg_id, thread, time_deleted, time_purged).fmsg_api_trash_state(addr, msg_id), which walks ancestors.Tests
TestTrashAndRestore: message and thread, later replies, list modes, get, and the item for push.TestPurge:TestPurgeKeepsPendingDelivery,TestTrashNotifies,TestHubRoute_MsgTrashPurged.🤖 Generated with Claude Code