[client] F22a: forget_contact, for Remove person #16
Reference in New Issue
Block a user
Delete Branch "feature/forget-contact"
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?
Client::forget_contact, for Amicitia's Remove person (F22). It deletes the contact's MLS group from OpenMLS's storage, drops its name and tokens, and stops fetching its mailbox. The other side is not told. Analysis:.agents/features/client-state.md, test 10. No change toPROTOCOL.md.Adversarial self-review — forget_contact
Evidence
cargo test --workspace --locked(Windows)amicitia_test, Android 15, x86_64)-D warnings), fmtNot verified
MlsGroup::deleteremoves every key of the group. The test shows the group cannot be loaded again, not that no byte of it is left. Signature keys are ours and shared by all groups, so they stay, as they should.Verdict
Merging.
@@ -304,0 +305,4 @@/// client, and its mailbox is no longer fetched. The other side is not told, and anything it/// still posts waits on the relay until it expires. Save the snapshot after it. Returns whether/// there was such a contact.pub fn forget_contact(&mut self, contact: ContactId) -> Result<bool, ClientError> {F1 — the other side is not told. Nothing is posted. What they send afterwards waits on the relay until the 30-day expiry, unread. That matches Remove person being local, and block is silent (
PROTOCOL.mdsection 3). If they should be stopped from posting at all, that is block (F24): rotating the post token.@@ -304,0 +310,4 @@return Ok(false);};let mut c = self.contacts.remove(index);c.groupF2 — a failure part-way. The contact is removed from the list before the group is deleted. If deleting fails, the call returns
Statewith the contact already gone from memory, and its group partly left in storage. The app saves the snapshot only on success, so the stored state stays whole, and a retry after a restart deletes it again.@@ -431,0 +436,4 @@/// Forgetting a contact leaves no name in the snapshot, stops fetching its mailbox, and survives a/// restart; the other contacts are untouched.#[test]fn a_forgotten_contact_leaves_nothing_behind() {F3 — what the test proves. The name is gone from the snapshot's bytes, and the group's state is gone from storage (a snapshot with the contact put back is refused). The mailbox is no longer fetched (the message waits), and the other contacts still work after a restart.
Merged into
mainwith--no-ffas2a8daa7570(remote hash verified). The self-review is on this PR.Pull request closed