{"record":{"id":"0340e3afd79aa62c","repo":"AprilNEA/OpenLogi","slug":"wheel-inversion-changed-unexpectedly-was-now","errorCode":null,"errorMessage":"wheel inversion changed unexpectedly: was {}, now {}","messagePattern":"wheel inversion changed unexpectedly: was (.+?), now (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/diag/wheel.rs","lineNumber":71,"sourceCode":"        .await\n        .context(\"set wheel resolution\")?;\n    print_mode(\"read-back\", after);\n\n    if after.resolution != requested {\n        anyhow::bail!(\n            \"wheel resolution write not applied: requested {}, device reports {}\",\n            resolution_label(requested),\n            resolution_label(after.resolution)\n        );\n    }\n    if after.target != ScrollReportingTarget::Native {\n        anyhow::bail!(\n            \"wheel reporting target is not native after write: {:?}\",\n            after.target\n        );\n    }\n    if after.inverted != before.inverted {\n        anyhow::bail!(\n            \"wheel inversion changed unexpectedly: was {}, now {}\",\n            before.inverted,\n            after.inverted\n        );\n    }\n\n    println!(\n        \"✓ wheel resolution set to {} (native reporting, inversion preserved)\",\n        resolution_label(requested)\n    );\n    Ok(())\n}\n\nfn print_mode(label: &str, mode: ScrollWheelMode) {\n    println!(\n        \"  {label}: resolution={} inversion={} reporting={}\",\n        resolution_label(mode.resolution),\n        if mode.inverted { \"inverted\" } else { \"normal\" },","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/diag/wheel.rs#L53-L89","documentation":"The `openlogi` wheel diagnostic verifies that after writing a new scroll-wheel resolution, the device's HiResWheel mode is read back and every other wheel attribute is unchanged. This bail fires when the wheel's inversion flag changed between the pre-write read and the post-write read-back, which should be impossible for a resolution-only write. It indicates the device (or the write path) mutated an unrelated wheel setting, so the diagnostic refuses to report success.","triggerScenarios":"Running `openlogi diag wheel --resolution <value>` (or `--device NAME --resolution ...`) against a HID++ device (PID 0x2121) where `set_scroll_resolution` flips the device's inversion flag relative to the `before` snapshot — i.e. the device firmware applies side effects or the driver writes an unintended register.","commonSituations":"Firmware quirks where changing the resolution register also toggles the inversion bit; an out-of-date or buggy `openlogi-hid` write path; a device concurrently modified by the running OpenLogi agent, Logitech Options+, or another HID client mid-diagnostic.","solutions":["Close other applications that may write HiResWheel settings (OpenLogi agent, Logitech Options+) and rerun the diagnostic so nothing mutates the wheel between reads.","Read the wheel mode again with `openlogi diag wheel` (no --resolution) to see whether inversion is stable on the device; if it flips without any write, the firmware is misbehaving.","Update OpenLogi (openlogi-hidpp / openlogi-hid) in case the write path has a known side-effect bug; report the device model/PID if it persists.","If the inversion change is intentional on your device, note that this is a diagnostic strictness guard: run the wheel write through the GUI/agent path instead."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before running the diagnostic, snapshot and later compare manually:\nlet before = openlogi_hid::get_scroll_wheel_mode(&route).await?;\nprintln!(\"inversion before: {}\", before.inverted);\n// after `set_scroll_resolution`:\nlet after = openlogi_hid::get_scroll_wheel_mode(&route).await?;\nif after.inverted != before.inverted { eprintln!(\"device mutated inversion flag\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stop the OpenLogi agent and any vendor utility before running hardware diagnostics so nothing else writes wheel registers.","Run the diagnostic twice when results look suspicious; a stable device reproduces identical inversion reads.","Keep openlogi-hid/openlogi-hidpp updated so resolution writes are side-effect free.","Report persistent inversion flips with device model and PID as a firmware/driver bug."],"tags":["hidpp","device-state","diagnostics","scroll-wheel"],"backgroundTag":"unexpected-response-shape","analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}