{"record":{"id":"4d7fd09d06cc5c02","repo":"AprilNEA/OpenLogi","slug":"wheel-resolution-write-not-applied-requested-device-reports","errorCode":null,"errorMessage":"wheel resolution write not applied: requested {}, device reports {}","messagePattern":"wheel resolution write not applied: requested (.+?), device reports (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/diag/wheel.rs","lineNumber":58,"sourceCode":"    let (route, name) = select_device(args.device.as_deref(), &[0x2121]).await?;\n    println!(\"device: {name} ({route})\");\n\n    let before = openlogi_hid::get_scroll_wheel_mode(&route)\n        .await\n        .context(\"read HiResWheel mode\")?;\n    print_mode(\"current\", before);\n\n    let Some(requested) = args.resolution.map(ScrollResolution::from) else {\n        return Ok(());\n    };\n\n    let after = openlogi_hid::set_scroll_resolution(&route, requested)\n        .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    }","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/diag/wheel.rs#L40-L76","documentation":"Raised by the wheel (scroll resolution) diagnostic after `set_scroll_resolution` writes a requested resolution and reads the reporting state back: `after.resolution` differs from `requested`. The transport accepted the write but the device does not report the requested scroll resolution, so the diagnostic fails rather than claiming success. Values are rendered via `resolution_label` in the message.","triggerScenarios":"Running the wheel diagnostic with a requested resolution where the read-back `after.resolution != requested` — device clamped the value to its supported range, rejected the write, or the write went to the wrong reporting target.","commonSituations":"Requesting a DPI/ratchet value outside the device's supported scroll-resolution table; firmware silently snapping to the nearest supported step; flaky wireless link dropping the set command; writing while the reporting target is not the native HID++ control.","solutions":["Clamp the requested resolution to the device's supported resolution set before writing.","Retry the write — the set command may have been lost on the wireless link.","Verify the wheel reporting target is Native before/when writing so the write reaches the right control.","Check firmware support for the exact resolution step on this model."],"exampleFix":"// before\nanyhow::bail!(\n    \"wheel resolution write not applied: requested {}, device reports {}\",\n    resolution_label(requested),\n    resolution_label(after.resolution)\n);\n// after\nlet requested = nearest_supported_resolution(&route, requested).await?;\nif 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}","handlingStrategy":"validation","validationCode":"// Only request resolutions the device actually supports\nlet supported = device_supported_scroll_resolutions(&route).await?;\nlet requested = supported.iter().copied().min_by_key(|r| (*r as i32 - wanted as i32).abs()).unwrap();","typeGuard":null,"tryCatchPattern":"match set_scroll_resolution(&route, requested).await {\n    Err(e) if e.to_string().contains(\"resolution write not applied\") => {\n        eprintln!(\"device reports {after:?}; falling back to nearest supported value\");\n    }\n    other => other?,\n}","preventionTips":["Validate the requested value against the device's resolution table before writing.","Verify the reporting target is Native before issuing resolution writes.","Retry once on wireless connections.","Log the read-back value, not just success/failure, for firmware debugging."],"tags":["hardware","hidpp","wheel","scroll-resolution","write-verification"],"backgroundTag":"device-write-not-applied","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"}