Skip to content

fix(motospeed): Add 63 byte packets to filter - #238

Open
jchu634 wants to merge 1 commit into
OpenMouse-Project:mainfrom
jchu634:fix/motospeed-packet
Open

jchu634 wants to merge 1 commit into
OpenMouse-Project:mainfrom
jchu634:fix/motospeed-packet

Conversation

@jchu634

@jchu634 jchu634 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Motospeed X6 devices declaring 63-byte B3 payloads were previously rejected, preventing settings requests and button remapping.
  • 63-byte payloads no longer raise an error.

Validation

  • npm run build passes.
  • Motospeed tests pass
  • Tested on device

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility with Motospeed devices that report 63-byte settings payloads, while preserving support for 60-byte payloads.

@github-actions github-actions Bot added type: bug PR title category: bug area: protocol Protocol codecs and shared types area: drivers Device drivers and transport integration area: tests Protocol and driver tests labels Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: OpenMouse-Project/mouse-protocol/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8e9ac1d7-246a-479b-9ae7-963b0eba1e17
📥 Commits

Reviewing files that changed from the base of the PR and between 4cadd7d and 44539e5.

📒 Files selected for processing: 2
  • src/drivers/motospeed/hid.test.ts
  • src/drivers/motospeed/hid.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The Motospeed HID client now accepts settings reports with a reported output length of 63 bytes. Tests cover supported and unsupported B3 report lengths and verify report sizes, payloads, and listener cleanup.

Changes: Motospeed B3 report lengths

Layer / File(s) Summary
Settings report handling and validation
src/drivers/motospeed/hid.ts, src/drivers/motospeed/hid.test.ts
The client accepts 63-byte settings reports without truncation. Tests cover lengths 0 and 59–64, including accepted report sizes and payloads, and rejection without sending reports or retaining listeners for unsupported lengths.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 44539

The change allows the intended 63-byte settings reports while preserving existing length handling. The inspected implementation and tests show no actionable merge risk.

Security architecture risk: ⚪ Minimal · up to 44539

The compatibility change enables expected settings operations on supported devices without broadening device selection or caller authority. Existing payload checks, response identity checks, and transaction handling remain in place. No material security risk was identified in the changed behavior.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The incremental exposure is settings communication with an already selected, supported HID device that declares a 63-byte settings report. Accepting that length does not add device identities, callers, or transport authority.

Trust Boundaries and Controls

  • observed — Opening the client still requires matching vendor, product, and control-collection characteristics. Settings responses must come from the exact client-owned device, use the expected report ID, and contain the expected command byte before decoding.

Resilience and Maintainability Implications

  • observed — Success, send failure, decode failure, timeout, and active-read cancellation converge on listener and timer cleanup. Hardware writes remain non-atomic with confirmation: a later confirmation failure does not undo a transmitted setting, and button mapping remains send-only. These transaction characteristics predate the PR rather than constituting newly introduced security concerns.
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: accepting 63-byte Motospeed packets in the filter.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: drivers Device drivers and transport integration area: protocol Protocol codecs and shared types area: tests Protocol and driver tests type: bug PR title category: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant