Skip to content

fix(logitech): do not reject lift-off on legacy scalar DPI formats - #244

Merged
7eedle merged 1 commit into
OpenMouse-Project:mainfrom
onyxhq-dev:fix/legacy-logitech-slot-lod
Oct 19, 2026
Merged

7eedle merged 1 commit into
OpenMouse-Project:mainfrom
onyxhq-dev:fix/legacy-logitech-slot-lod

Conversation

@onyxhq-dev

@onyxhq-dev onyxhq-dev commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On the G305 (profile format 3), enabling the third DPI slot fails the flash with "Slot 3 cannot store lift-off distance".

Cause

Formats below 6 store only a DPI value per slot, and the writer never writes lift-off for them. validateDpiStagePlan still required lod === 0 on those formats. A new slot copies lift-off from the previous slot, so the plan was rejected before it reached the mouse.

Fix

Drop the check on legacy scalar formats. The value is ignored on write, so it cannot reach flash.

Tests

  • Added a regression test: a three-slot plan with lift-off 2 on every slot validates on format 3. It fails without the fix.
  • onboard-profiles.test.ts passes.
  • Confirmed by the reporting G305 user on a test build.

Summary by CodeRabbit

  • Bug Fixes
    • Legacy DPI profiles no longer fail validation solely because their stages have nonzero lift-off settings. X and Y DPI values must still match, and these formats do not save lift-off settings.

Formats below 6 (for example the G305, format 3) store only a DPI value per
slot and the writer never writes lift-off for them. The validator still
required lod === 0, so enabling a new slot (which copies lift-off from the
previous slot) failed the flash with "Slot 3 cannot store lift-off distance".
The value is now ignored on these formats.
@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 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 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: f3b02a35-9d8b-40c9-bf55-d2396c8f6ba1
📥 Commits

Reviewing files that changed from the base of the PR and between 54c68c6 and bb68f91.

📒 Files selected for processing: 2
  • src/drivers/logitech/onboard-profiles.test.ts
  • src/drivers/logitech/onboard-profiles.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 legacy-scalar DPI validator no longer rejects nonzero lift-off values. A test checks that format 3 accepts a three-stage DPI plan with lift-off level 2 on each stage.

Changes: Logitech DPI validation

Layer / File(s) Summary
Legacy scalar DPI validation
src/drivers/logitech/onboard-profiles.ts, src/drivers/logitech/onboard-profiles.test.ts
Legacy scalar validation still requires matching X and Y DPI but no longer rejects nonzero lift-off values. A format-3 test checks a three-stage plan with lift-off level 2 on every stage.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: snekxs

Merge Risk: ⚪ Minimal · up to bb68f

Legacy profiles ignore lift-off when writing, so accepting nonzero UI defaults allows the supported DPI plan to proceed without changing device behavior. No merge-blocking issue is evident.

### Architecture Summary

Architecture risk: 🔵 Low · up to bb68f

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in src/drivers/logitech/onboard-profiles.test.ts: Adds a test for a format-3 plan with DPI values 800, 1200, and 1600 and lift-off level 2 on each stage; it expects validation with the third argument true to return null.
  • observed — Modified behavior in src/drivers/logitech/onboard-profiles.ts: In the legacy-scalar branch, removed the validation error for nonzero stage.lod; matching X/Y DPI remains required, and the comment now states that lift-off is not stored or written for these formats.
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 and concisely describes the main change: allowing lift-off values on legacy scalar DPI formats.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
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.
✨ 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.

@7eedle
7eedle merged commit bac0315 into OpenMouse-Project:main Oct 19, 2026
5 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.45.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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 released type: bug PR title category: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants