[client] F24: block and unblock as staged rotates, delivery receipts, payloads documented #18
Reference in New Issue
Block a user
Delete Branch "feature/block-receipts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
F24 in the client: block, unblock, and delivered (Amicitia #52). Analysis:
.agents/features/block-and-receipts.md.block(contact)is staged: the contact is marked, and the returnedOutgoingis a rotate of our mailbox's post token to the hash of a token nobody gets. Nothing is sent to them; their posts get the ordinary 404. Texts from them that still arrive are dropped and never shown.unblock(contact): a rotate to a new token, and that token to them in aninboxpayload.readdressswaps the new token into a post waiting in their app's outbox.seq, and the receiver answersreceipt {upto}after the app has saved them (Event::Delivered). They are reciprocal: off means none are sent and none are reported. On by default; the snapshot keeps the setting.Outgoingis now one relay operation (a post or a rotate), so block and unblock follow the same save, then send rule.Transportgainsrotate_post_token(section 8's existing route).finishskips a post refused with 404, so a blocked person's client still acknowledges what it fetched (found by a test).PROTOCOL.mdsection 4: the payloads inside MLS are written down. The relay is unchanged.Adversarial self-review — F24, block and receipts
Evidence
cargo test --workspace --locked(Windows)amicitia_test, Android 15, x86_64)-D warnings), fmt,check-deps.shmutate_block.py)block, not stagedreaddressleaves the old tokenfinishstops at a refused postFound while building
finishdelivered a blocked person's receipt, got 404, and returned before acknowledging anything. Their client would have fetched the same messages for ever. Fixed (B4), with its own test.Not verified
deny_unknown_fieldson payloads means it would refuse atextwithseq. No such client exists outside this repository (pre-release); stated in B5.Verdict
Merging; B1–B7 are on their lines.
@@ -117,3 +122,1 @@to: MailboxId,post: Token,blob: Bytes,#[serde(transparent)]B5 — compatibility.
Outgoingis now{op: post|rotate, …}. An app's outbox rows from before F24 have noopand no longer parse (Amicitia drops unparseable rows, its R8). Payloads gainedseqand two kinds; withdeny_unknown_fields, a client from before F24 would refuse them. Both are acceptable before the first release, and wrong after it. From the first release, a payload change needs a version.@@ -453,0 +526,4 @@/// Blocks a contact, staged: they are marked, and their way into our mailbox is closed by a/// rotate to the hash of a fresh token that nobody gets. Nothing is sent to them. Save the/// snapshot, then deliver the result.pub fn block(&mut self, contact: ContactId) -> Result<Outgoing, ClientError> {B1 — privacy: the blocked person is not told. Block sends nothing to them and changes nothing they can see, except that their posts now get 404. That is section 8's answer for any wrong token, so the protocol does not say blocked. A person whose messages never leave their outbox may still guess. Stated in the analysis.
@@ -543,1 +676,4 @@}// Receipts, for every contact whose texts arrived now. Delivered by `finish`, so only// after the app has saved the texts.if self.receipts {B3 — privacy: receipts tell the sender when your app was open. They are reciprocal: off means you send none and see none. That is the usual fair rule, and it stops someone from seeing others' receipts while hiding their own. On by default [decided by default]; the app must say what it costs where the switch is.
@@ -555,2 +711,3 @@for out in &received.outgoing {self.deliver(out)?;match self.deliver(out) {Ok(()) | Err(ClientError::Transport(TransportError::NotFound)) => {}B4 — found by a test. A blocked person's client delivered a receipt, got 404, and
finishreturned before acknowledging. Their app would have refetched the same blobs for ever. A 404 cannot succeed on retry, so it is skipped; other failures still stopfinishso it can be retried.@@ -659,3 +818,4 @@// Text before hello: not from a conversation that has been set up.return Err(ClientError::Mls);}if c.blocked {B2 — what was in flight. Texts they posted before the block, or that arrive in the same fetch, are dropped and never shown, and still acknowledged, so they leave the relay. No receipt is sent for them (a blocked contact gets no receipt).
@@ -667,0 +839,4 @@upto: upto.min(c.sent_seq),}))}Payload::Inbox { post_token } => {B6 —
inboxis narrow. It replaces the token for the mailbox theirhellonamed, never the mailbox. A contact cannot use it to redirect our posts elsewhere (unit test). MLS authenticates that it comes from them.@@ -46,6 +46,19 @@ MLS**. To the relay, the welcome mailbox is an ordinary mailbox.*(Changed 2026-11-14, approved by Mark, from "the invitee replies with their own KeyPackage": theinvitee needs no KeyPackage, because it creates the group itself.)*### Payloads inside MLS *(added 2026-11-17, F24; `.agents/features/block-and-receipts.md`)*B7 — the payloads are now in the protocol. Another app needs them to talk to this one. Dated, with the reason. The relay's part (sections 5 and 8) is unchanged: block uses the existing rotate route.
Merged into
mainwith--no-ffasdff1bec275(remote hash verified). The self-review is on this PR.Pull request closed