Repository navigation
Follow the spec rules for client/hello and audio chunk headers - #211
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the rc1 protocol alignment.
No open issues 🎉
What changed in this PR
Aligns the Sendspin SDK with the rc1 protocol, correcting audio payload parsing and removing obsolete handshake fields. This introduces breaking compatibility changes for older servers and affected public types.
Changes:
- Skip the full 13-byte audio chunk header without using
send_aheadfor playback. - Remove
trust_leveland playersupported_commandsfromclient/hello. - Read pairing language preferences from
server/helloand update regression coverage.
| File | Description |
|---|---|
tests/unit/transport.test.ts |
Remove the obsolete handshake trust-level assertion. |
tests/unit/transport-unpair.test.ts |
Clarify the unpair test comment using PSK category terminology. |
tests/unit/transport-rehandshake.test.ts |
Assert PSK category instead of trust level. |
tests/unit/protocol-handler.test.ts |
Verify removed fields are absent from client/hello. |
tests/unit/pairing.test.ts |
Test hello-sourced languages and retention across re-handshakes. |
tests/unit/decoder.test.ts |
Build audio fixtures with 13-byte headers and nonzero send_ahead. |
tests/unit/decoder-codecs.test.ts |
Update codec fixtures to use 13-byte headers. |
tests/helpers/sendspin-server.py |
Configure language preferences for pairing tests. |
tests/helpers/known-violations.ts |
Remove the two resolved hello-format violations. |
tests/e2e/sendspin-security.e2e.test.ts |
Verify pairing callbacks receive server language preferences. |
src/types.ts |
Remove obsolete hello fields and activation-level languages. |
src/core/transport.ts |
Remove derived trust-level metadata and clarify the unpair comment. |
src/core/protocol-handler.ts |
Stop emitting obsolete client/hello fields. |
src/core/pairing.ts |
Store hello-sourced languages independently of pairing attempts. |
src/core/core.ts |
Route server/hello languages to the pairing manager. |
src/audio/decoder.ts |
Start audio decoding after the full 13-byte header. |
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?
Audio from a server that sends the spec's 13-byte audio chunk header was corrupted, since the client read the 4-byte
send_aheadfield as audio. The client also senttrust_leveland playersupported_commandsinclient/hello, which strict servers reject.The client now sends the rc1
client/helloand skips the full 13-byte header, andsend_aheaddoesn't affect playback. The operator'slanguagesfor a spoken pairing code are now read fromserver/hello, where the spec defines them.Breaking changes:
ClientHellono longer hastrust_levelor playersupported_commands, andActivatePairingno longer haslanguages.Closing the connection on an audio message shorter than 13 bytes is left for a later PR.
Related issue or spec PR (if applicable):
trust_levelfromclient/hellospec#158supported_commandsmid-session spec#177Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocumentationmaintenancecidependencies