Repository navigation
Follow the spec rules for message fragmentation - #202
Merged
Merged
Conversation
Fragmented messages from a spec-compliant server were dropped, and a control message over one Noise transport message threw instead of being sent.
There was a problem hiding this comment.
🟢 Approval recommended
Static review supports the framing and size calculations, with no unresolved blocking findings; tests were not executed.
No open issues 🎉
What changed in this PR
Updates Sendspin transport fragmentation to match the specification, allowing large messages to be received and sent using ID 1 with fragment flags. Legacy ID 2/3 fragments are no longer recognized.
Changes:
- Adds flag-based fragment reassembly and closes connections on malformed sequences.
- Splits oversized outbound control messages into transport-sized fragments.
- Updates tests for the new format, invalid sequences, and outbound fragmentation.
| File | Description |
|---|---|
| tests/unit/transport.test.ts | Updates inbound fragment fixtures to ID 1 with flags. |
| tests/unit/transport-framing.test.ts | Covers malformed sequences, empty payloads, and outbound fragmentation. |
| src/core/transport.ts | Implements flag-based framing, validation, and outbound splitting. |
Review effort: Balanced
33 tasks done
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.
What does this implement/fix?
Fragmented messages from a server following the spec were dropped, since the client only understood the old ID 2/3 fragment format. Sending a message larger than one Noise transport message threw instead of being fragmented.
Fragments now use ID 1 with a flags byte in both directions, and a malformed fragment sequence closes the connection. IDs 2 and 3 are now ignored like any other unknown binary ID.
Breaking changes:
Related issue or spec PR (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocumentationmaintenancecidependencies