Repository navigation
Fix paired clients losing playback after a cancelled re-pair - #479
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Cancellation during restoration can leave the encrypted connection open in an unusable state.
Review effort: Balanced
Findings: 1
What changed in this PR
Restores paired clients to their long-term PSK after an unfinished re-pairing attempt.
Changes:
- Re-handshakes back to the stored pairing record.
- Closes connections when restoration fails.
- Adds integration coverage for restoration and failure paths.
| File | Description |
|---|---|
aiosendspin/server/connection.py |
Implements session restoration. |
aiosendspin/server/server.py |
Updates API documentation. |
tests/integration/test_noise_pairing_flow.py |
Tests cancellation, restoration, and failure handling. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
maximmaxim345
force-pushed
the
fix/restore-long-term-after-failed-re-pair
branch
from
October 5, 2026 06:30
420d7b8 to
f485ffb
Compare
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?
Cancelling or failing a pairing attempt on an already paired client left it without playback until it reconnected. The attempt moves the connection off the client's long-term PSK, and nothing moved it back.
Now the server re-handshakes back onto the stored long-term PSK after the leave
server/activate, restoring playback and roles on the same connection. If that re-handshake fails, the server closes the connection so the client reconnects.Related issue or spec PR (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocumentationmaintenancecidependencies