Skip to content

Follow the spec rules for client/hello and audio chunk headers - #211

Merged
maximmaxim345 merged 2 commits into
mainfrom
fix/rc1-hello-audio-header
Oct 28, 2026
Merged

maximmaxim345 merged 2 commits into
mainfrom
fix/rc1-hello-audio-header

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

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_ahead field as audio. The client also sent trust_level and player supported_commands in client/hello, which strict servers reject.

The client now sends the rc1 client/hello and skips the full 13-byte header, and send_ahead doesn't affect playback. The operator's languages for a spoken pairing code are now read from server/hello, where the spec defines them.

Breaking changes:

  • A server that still sends 9-byte audio chunk headers now plays corrupted audio.
  • ClientHello no longer has trust_level or player supported_commands, and ActivatePairing no longer has languages.

Closing the connection on an audio message shorter than 13 bytes is left for a later PR.

Related issue or spec PR (if applicable):

Types of changes

  • Bugfix (non-breaking change which fixes an issue): bugfix
  • New feature (non-breaking change which adds functionality): new-feature
  • Enhancement to an existing feature: enhancement
  • Breaking change (changes the public API or the protocol in a way that is not backwards compatible): breaking-change
  • Refactor (no behavior change): refactor
  • Documentation only: documentation
  • Maintenance / chore: maintenance
  • CI / workflow change: ci
  • Dependencies bump: dependencies

@maximmaxim345
maximmaxim345 requested a balanced review from Copilot October 28, 2026 09:20
@github-actions github-actions Bot added the breaking-change Changes the public API or the protocol in a way that is not backwards compatible label Oct 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_ahead for playback.
  • Remove trust_level and player supported_commands from client/hello.
  • Read pairing language preferences from server/hello and 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

@maximmaxim345
maximmaxim345 merged commit 4ab3e9a into main Oct 28, 2026
4 checks passed
@maximmaxim345
maximmaxim345 deleted the fix/rc1-hello-audio-header branch October 28, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Changes the public API or the protocol in a way that is not backwards compatible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants