Repository navigation
Clamp out-of-range output_delay_ms in server commands - #467
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the specification while retaining strict validation for server-generated commands.
Review effort: Balanced
Findings: None
What changed in this PR
Clamps out-of-range client output_delay_ms commands as required by the Sendspin specification.
Changes:
- Clamps parsed delays to 0–5000 ms.
- Adds an end-to-end upper-bound test.
- Preserves outbound command validation.
| File | Description |
|---|---|
aiosendspin/models/player.py |
Clamps delay during command deserialization. |
tests/test_client_protocol_callbacks.py |
Verifies an excessive delay is applied as 5000 ms. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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 dropped a
set_output_delaycommand withoutput_delay_msoutside 0-5000, since parsing failed before the client's own clamp was reached.The value is now clamped while parsing, as the spec requires, and the clamped delay is applied. The server still rejects out-of-range values in commands it sends.
Related issue or spec PR (if applicable):
output_delay_msspec#176Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocumentationmaintenancecidependencies