{"record":{"id":"a74f23d024655f99","repo":"AprilNEA/OpenLogi","slug":"smartshift-sensitivity-write-not-applied-requested-n-device","errorCode":null,"errorMessage":"SmartShift sensitivity write not applied: requested {n}, device reports {}","messagePattern":"SmartShift sensitivity write not applied: requested (.+?), device reports (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/diag/smartshift.rs","lineNumber":57,"sourceCode":"        let requested = SmartShiftAutoDisengage::from(n);\n        let before = openlogi_hid::get_smartshift_status(&route)\n            .await\n            .context(\"read SmartShift status\")?;\n        println!(\n            \"  current: mode={:?} sensitivity={}\",\n            before.mode, before.auto_disengage\n        );\n\n        let after = openlogi_hid::set_smartshift_sensitivity(&route, requested)\n            .await\n            .context(\"set SmartShift sensitivity\")?;\n        println!(\n            \"  read-back: mode={:?} sensitivity={}\",\n            after.mode, after.auto_disengage\n        );\n\n        if after.auto_disengage != requested {\n            anyhow::bail!(\n                \"SmartShift sensitivity write not applied: requested {n}, device reports {}\",\n                after.auto_disengage\n            );\n        }\n        if after.mode != before.mode {\n            anyhow::bail!(\n                \"SmartShift mode changed unexpectedly: was {:?}, now {:?}\",\n                before.mode,\n                after.mode\n            );\n        }\n\n        println!(\n            \"✓ SmartShift sensitivity set to {n} (mode {:?} preserved)\",\n            after.mode\n        );\n        return Ok(());\n    }","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/diag/smartshift.rs#L39-L75","documentation":"This error is raised by the SmartShift hardware diagnostic in openlogi-cli after it writes a new sensitivity (auto-disengage) value to the device and then reads it back. It means the read-back value does not match the requested value, i.e. the HID++ write was accepted by the transport but the device did not actually apply (or persist/reflect) the new sensitivity. The library throws it so the diagnostic fails loudly instead of reporting success on a silent write failure.","triggerScenarios":"Running the SmartShift diagnostic (`openlogi` smartshift diag) with a requested sensitivity `n`, where the subsequent read-back (`after.auto_disengage`) differs from `requested` — e.g. the device rejected the value, clamped it, the write targeted the wrong feature register, or the device firmware does not support the requested sensitivity range.","commonSituations":"Device firmware silently clamping sensitivity to its supported range; writing to a device that only partially implements the SmartShift/relevant HID++ feature; a stale HID route pointing at the wrong device or a receiver vs direct-connection mismatch; flaky wireless link dropping the set-command.","solutions":["Re-read the device's supported sensitivity range and clamp the requested value to it before writing.","Verify the HID route targets the correct device (receiver vs direct connection) and retry the diagnostic.","Update device firmware / check whether the model fully implements the SmartShift sensitivity feature.","Retry the write — a flaky wireless link can drop the set command while reads still succeed."],"exampleFix":"// before\nanyhow::bail!(\n    \"SmartShift sensitivity write not applied: requested {n}, device reports {}\",\n    after.auto_disengage\n);\n// after\nlet clamped = requested.clamp(min_supported, max_supported);\nif after.auto_disengage != clamped {\n    anyhow::bail!(\n        \"SmartShift sensitivity write not applied: requested {clamped}, device reports {}\",\n        after.auto_disengage\n    );\n}","handlingStrategy":"validation","validationCode":"// Clamp to the device's supported sensitivity range before writing\nlet range = device.smartshift_sensitivity_range(); // e.g. 1..=9\nlet requested = requested.clamp(*range.start(), *range.end());\nif requested != original_request {\n    eprintln!(\"clamping sensitivity {original_request} -> {requested}\");\n}","typeGuard":null,"tryCatchPattern":"match diag_result {\n    Err(e) if e.to_string().contains(\"sensitivity write not applied\") => {\n        // retry once, then fall back to reporting the device's current value\n        eprintln!(\"write not applied: {e}; retrying...\");\n    }\n    Err(e) => return Err(e),\n    Ok(report) => println!(\"applied: {report:?}\"),\n}","preventionTips":["Always read the device's supported sensitivity range before writing.","Prefer read-back verification in every hardware write path.","Retry writes once over wireless links before failing.","Keep device firmware current — partial HID++ feature support causes silent clamping."],"tags":["hardware","hidpp","smartshift","write-verification","diagnostics"],"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"}