Implement leave handling in /feedback (posta.room/v1 + text fallback) #5

Open
opened 2026-05-13 18:45:13 +02:00 by arne · 0 comments
Owner

What to build

Wire up the leave semantics in posta-web's room logic.

Inbound dispatch grows two new cases:

Inbound Effect
`posta.room/v1` `action="leave"` Remove sender from `subscribers`. Do not archive as content. Do not fan out. Return `204`.
`posta.text/v1` body trimmed-lowered == `"leave"` Same effect. Compat fallback for clients that only speak `posta.text/v1` today.

Idempotent — a leave from a non-subscriber is a no-op (still `204`).

Everything else stays per posta/web#4 (any other text body archives, subscribes, and fans out; any other kind archives but doesn't fan out).

Acceptance criteria

  • A `posta.room/v1` action="leave" from a current subscriber removes them and returns `204`
  • A `posta.text/v1` body "leave" (with surrounding whitespace, mixed case) has the same effect
  • Leave messages are not archived as content (do not appear in the HTML archive) and not fanned out
  • Leave from a non-subscriber returns `204` and changes no state
  • After leaving, a follow-up `posta.text/v1` from the same sender re-adds them per the implicit-subscribe rule
  • Tests cover both the `posta.room/v1` form and the text-body fallback

Blocked by

## What to build Wire up the leave semantics in posta-web's room logic. Inbound dispatch grows two new cases: | Inbound | Effect | |---|---| | \`posta.room/v1\` \`action=\"leave\"\` | Remove sender from \`subscribers\`. Do not archive as content. Do not fan out. Return \`204\`. | | \`posta.text/v1\` body trimmed-lowered == \`\"leave\"\` | Same effect. Compat fallback for clients that only speak \`posta.text/v1\` today. | Idempotent — a leave from a non-subscriber is a no-op (still \`204\`). Everything else stays per posta/web#4 (any other text body archives, subscribes, and fans out; any other kind archives but doesn't fan out). ## Acceptance criteria - [ ] A \`posta.room/v1\` action=\"leave\" from a current subscriber removes them and returns \`204\` - [ ] A \`posta.text/v1\` body \"leave\" (with surrounding whitespace, mixed case) has the same effect - [ ] Leave messages are not archived as content (do not appear in the HTML archive) and not fanned out - [ ] Leave from a non-subscriber returns \`204\` and changes no state - [ ] After leaving, a follow-up \`posta.text/v1\` from the same sender re-adds them per the implicit-subscribe rule - [ ] Tests cover both the \`posta.room/v1\` form and the text-body fallback ## Blocked by - posta/spec#3 (needs \`action=\"leave\"\` defined in the spec) - posta/web#4 (needs subscribers + fan-out)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
posta/web#5
No description provided.