Skip to content

Deliver add-to messages to all participant domains (SPEC v0.4.0) - #28

Merged
markmnl merged 1 commit into
mainfrom
add-to-participant-notification
Aug 3, 2026
Merged

Deliver add-to messages to all participant domains (SPEC v0.4.0)#28
markmnl merged 1 commit into
mainfrom
add-to-participant-notification

Conversation

@markmnl

@markmnl markmnl commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Implements add-to participant notification per the updated spec: an add-to message is sent to every participant domain of the message being added to -- the domains of from and every to address as well as the new recipients' -- so all participants learn recipients were added, not only the domains hosting the new batch.

Receiving side:

  • A message with add-to is accepted when any participant (not only a recipient) belongs to this host's domain; such participant-only deliveries complete at code 11 through the existing path, which records the batch.
  • An add-to whose parent is not stored is rejected with code 6 (parent not found) when this host has no recipient to deliver to; with a recipient it is treated as a full message delivery as before.
  • An add-to batch already recorded is rejected with code 10 (duplicate).
  • attachAddToRecipients marks rows for other domains with response code 11 so a host recording a received batch never treats those rows as its own delivery work.

Sending side:

  • New msg_add_to_notify table tracks one row per (batch, participant domain) owed a notification, with the same retry/back-off state as recipient rows; a trigger wakes the sender when rows appear.
  • findPendingTargets and deliverUnit deliver an add-to unit to a domain with a pending notify row even when it holds none of the batch's recipients, recording the outcome on the notify row.
  • Add-to recipient rows now age against their batch's time_added rather than the message's time_sent, so batches added long after a message was sent still deliver.

Also adds a recipients_added notify channel fired when a batch is recorded (locally created or received), so API layers can push the updated recipient list to connected participants, and syncs SPEC.md from fmsg-spec.

Implements add-to participant notification per the updated spec: an
add-to message is sent to every participant domain of the message being
added to -- the domains of from and every to address as well as the new
recipients' -- so all participants learn recipients were added, not
only the domains hosting the new batch.

Receiving side:
- A message with add-to is accepted when any participant (not only a
  recipient) belongs to this host's domain; such participant-only
  deliveries complete at code 11 through the existing path, which
  records the batch.
- An add-to whose parent is not stored is rejected with code 6 (parent
  not found) when this host has no recipient to deliver to; with a
  recipient it is treated as a full message delivery as before.
- An add-to batch already recorded is rejected with code 10 (duplicate).
- attachAddToRecipients marks rows for other domains with response code
  11 so a host recording a received batch never treats those rows as
  its own delivery work.

Sending side:
- New msg_add_to_notify table tracks one row per (batch, participant
  domain) owed a notification, with the same retry/back-off state as
  recipient rows; a trigger wakes the sender when rows appear.
- findPendingTargets and deliverUnit deliver an add-to unit to a domain
  with a pending notify row even when it holds none of the batch's
  recipients, recording the outcome on the notify row.
- Add-to recipient rows now age against their batch's time_added rather
  than the message's time_sent, so batches added long after a message
  was sent still deliver.

Also adds a recipients_added notify channel fired when a batch is
recorded (locally created or received), so API layers can push the
updated recipient list to connected participants, and syncs SPEC.md
from fmsg-spec.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@markmnl
markmnl merged commit 8b2aaa4 into main Aug 3, 2026
2 of 3 checks passed
@markmnl
markmnl deleted the add-to-participant-notification branch August 3, 2026 07:55
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