Add integration test 013: multi-recipient and multi-domain fan-out - #19
Merged
Conversation
Every other test sends to exactly one recipient, leaving two things unexercised (SPEC §10.2, §10.2 step 6, §10.4 step 6): The per-recipient response byte STREAM. When two recipients share a domain the sending host opens one connection and reads one byte per recipient, matched positionally to _to_ order; with a single recipient a misaligned stream is indistinguishable from a correct one. Cases A1/A2 pair the unseeded dave (rejected 100) with bob (accepted 200) and send them in BOTH orders — identical codes would prove nothing, whereas differing codes in both orders catch both a one-byte misalignment and an implementation matching codes to addresses rather than positions. Fan-out across unique recipient domains, where responsibility is split: case B addresses one message to hairpin.local and example.com at once, so alice's outcome is recorded by fmsgd off the wire while carol's comes from fmsg-webapi's resolveLocalDelivery — fmsgd's sender skips the local domain, so nothing else would ever set it. Both cases additionally assert what SPEC §11 makes a MUST and no test covered: a receiving host retains the COMPLETE _to_ list, including recipients on other domains and ones it rejected, so participant checks and hash recomputation stay faithful. Verified the ordering assertion can fail: swapping A1's expected codes makes the test fail as expected, and it passes again when restored. fmsg-cli has no multi-recipient send, so these go out as drafts whose recipient list is replaced by `update --to`. The body is passed again on that call deliberately — despite the CLI's "only provided fields are updated", PUT /fmsg/:id rewrites the whole message from the payload. Co-Authored-By: Claude Opus 5 (1M context) <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.
Every other test sends to exactly one recipient, leaving two things unexercised (SPEC §10.2, §10.2 step 6, §10.4 step 6).
1. The per-recipient response byte stream. When two recipients share a domain, the sending host opens one connection and reads one byte per recipient, matched positionally to
_to_order. With a single recipient, a misaligned stream is indistinguishable from a correct one. So cases A1/A2 pair the unseeded@dave@example.com(rejected 100, per test 012) with@bob@example.com(accepted 200) and send them in both orders:_to_order[dave, bob][100, 200][bob, dave][200, 100]Identical codes would prove nothing. Differing codes in both orders catch both a one-byte misalignment and an implementation that matches codes to addresses rather than to positions — with a single ordering, either bug still passes.
2. Fan-out across unique recipient domains, where responsibility is split. Case B addresses one message to hairpin.local and example.com at once: alice's outcome is recorded by fmsgd off the wire, carol's by fmsg-webapi's
resolveLocalDelivery— fmsgd's sender deliberately skips the local domain, so nothing else would ever set it.Both cases additionally assert something SPEC §11 makes a MUST and no test covered: a receiving host retains the complete
_to_list, including recipients on other domains and ones it rejected, so participant checks and hash recomputation stay faithful.Notes
expected code 200 for @dave@example.com, got '100'), and it passes again when restored. A test that passes on the first run is worth proving isn't vacuous.send, so these go out as drafts whose recipient list is replaced viaupdate --to. The body is passed again on that call deliberately: despite the CLI's "only provided fields are updated",PUT /fmsg/:idrewrites the whole message from the payload, so a bodyless update would leave an empty body. That mismatch looks like a genuine bug in the CLI/webapi contract — worth its own issue rather than a fix smuggled into a test PR.tests-to-add.md: 013 crossed off, and 014 narrowed — it now covers only the untested remainder (a message with only local recipients, which never reaches fmsgd's outbound sender).Full suite locally: 13 passed, 0 failed.
🤖 Generated with Claude Code