Repository navigation
Follow the spec rules for server/activate - #193
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Newly accepted combined pairing/playback activations still suspend playback-related protocol handling and discard authorized queued controller commands.
2 open issues
What changed in this PR
This PR aligns the SDK’s server/activate authorization and role persistence with the protocol specification, reducing incorrect connection closures.
Changes:
- Updates allowed activities and
pairing_requiredhandling for pairing and Sentinel PSKs. - Preserves omitted
active_rolesacross activations and re-handshakes, clearing effective roles when playback is no longer permitted. - Removes
managementfrom the public activation type and updates regression tests.
| File | Description |
|---|---|
| tests/unit/transport-rehandshake.test.ts | Tests role persistence and pairing-PSK re-handshakes. |
| tests/unit/transport-activate.test.ts | Tests omitted and persisted activation roles. |
| tests/unit/activate-authorization.test.ts | Covers revised authorization rules and effective roles. |
| src/types.ts | Removes management from activation activities. |
| src/core/transport.ts | Persists and forwards effective activation roles. |
| src/core/activate-authorization.ts | Revises activity authorization and role resolution. |
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?
The client closed the connection with
unauthorizedon several activations the spec allows: a firstserver/activatewithoutactive_roles, one after a re-handshake that leaves them out, and pairing PSK activations like[]to cancel a pairing attempt or playback with unpaired access.The allowed activity sets now follow the spec table.
active_rolespersist across a re-handshake and are treated as empty once the connection can no longer play back.pairing_requiredis now also sent on pairing PSK sessions.The
managementactivity is removed fromServerActivate, and servers that send it are closed withunauthorized.Related issue or spec PR (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocumentationmaintenancecidependencies