Deliver add-to messages to all participant domains (SPEC v0.4.0) - #28
Merged
Conversation
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>
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.
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:
Sending side:
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.