Skip to content

Clamp out-of-range output_delay_ms in server commands - #467

Merged
maximmaxim345 merged 1 commit into
mainfrom
fix/clamp-received-output-delay
Oct 2, 2026
Merged

maximmaxim345 merged 1 commit into
mainfrom
fix/clamp-received-output-delay

Conversation

@maximmaxim345

Copy link
Copy Markdown
Member

What does this implement/fix?

The client dropped a set_output_delay command with output_delay_ms outside 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):

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 2, 2026 06:35
@github-actions github-actions Bot added the bugfix Fixes a bug label Oct 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@maximmaxim345
maximmaxim345 merged commit 6f94dc8 into main Oct 2, 2026
4 checks passed
@maximmaxim345
maximmaxim345 deleted the fix/clamp-received-output-delay branch October 2, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants