{"record":{"id":"067dab3960cbebc4","repo":"AprilNEA/OpenLogi","slug":"smartshift-toggle-had-no-effect-still-after-write","errorCode":null,"errorMessage":"SmartShift toggle had no effect: still {:?} after write","messagePattern":"SmartShift toggle had no effect: still (.+?) after write","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/diag/smartshift.rs","lineNumber":103,"sourceCode":"    );\n\n    let new_mode = openlogi_hid::toggle_smartshift(&route)\n        .await\n        .context(\"toggle SmartShift\")?;\n    println!(\"  toggled to: {new_mode:?}\");\n\n    let after = openlogi_hid::get_smartshift_status(&route)\n        .await\n        .context(\"read SmartShift after toggle\")?;\n    println!(\n        \"  read-back: mode={:?} auto_disengage={} torque={}\",\n        after.mode,\n        after.auto_disengage,\n        after.tunable_torque.map_or(0, TunableTorque::into_inner)\n    );\n\n    if after.mode == before.mode {\n        anyhow::bail!(\n            \"SmartShift toggle had no effect: still {:?} after write\",\n            before.mode\n        );\n    }\n\n    if args.leave_flipped {\n        println!(\"✓ SmartShift toggle OK (wheel left in {new_mode:?})\");\n        return Ok(());\n    }\n\n    println!(\"  restoring mode: {:?}\", before.mode);\n    openlogi_hid::toggle_smartshift(&route)\n        .await\n        .context(\"restore SmartShift\")?;\n\n    println!(\"✓ SmartShift round-trip OK\");\n    Ok(())\n}","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/diag/smartshift.rs#L85-L121","documentation":"Raised by the SmartShift toggle diagnostic after it flips the SmartShift mode and reads the state back: the mode is identical to the pre-write value, so the toggle had no observable effect. The library throws it because a toggle that does not change state means the write silently failed or was rejected, and reporting success would be misleading.","triggerScenarios":"Running the SmartShift toggle diagnostic where `after.mode == before.mode` after the toggle write — the device ignored the mode set command, the write was lost on the wireless link, or the feature is not actually implemented by the device.","commonSituations":"Device that reports the SmartShift feature but ignores mode writes (partial firmware support); flaky Bolt/Unifying receiver link; wrong HID route (writing to a different device than the one read); mode already at the target and the toggle logic wrote the same value back.","solutions":["Retry the toggle — a single lost HID++ write over a wireless link is common.","Verify the HID route resolves to the same device used for the before-read.","Check the device actually supports writable SmartShift mode (not just readable) via feature dispatch.","Ensure no other process is immediately resetting the mode after the write."],"exampleFix":"// before\nif after.mode == before.mode {\n    anyhow::bail!(\"SmartShift toggle had no effect: still {:?} after write\", before.mode);\n}\n// after\nif after.mode == before.mode {\n    // one retry for flaky wireless writes\n    openlogi_hid::toggle_smartshift(&route).await.context(\"retry toggle\")?;\n    let after = openlogi_hid::read_smartshift(&route).await?;\n    if after.mode == before.mode {\n        anyhow::bail!(\"SmartShift toggle had no effect: still {:?} after write\", before.mode);\n    }\n}","handlingStrategy":"retry","validationCode":"// Verify the device exposes a writable SmartShift mode feature before toggling\nlet caps = device_feature_caps(&route).await?;\nif !caps.smartshift_mode_writable {\n    anyhow::bail!(\"device does not support writable SmartShift mode\");\n}","typeGuard":null,"tryCatchPattern":"for attempt in 0..2 {\n    match run_smartshift_toggle_diag(&route).await {\n        Err(e) if e.to_string().contains(\"had no effect\") && attempt == 0 => continue,\n        other => break other,\n    }\n}","preventionTips":["Retry toggle writes once — single HID++ writes over wireless links are lossy.","Confirm the feature is writable, not merely advertised, before toggling.","Use the same HID route for the before-read, write, and after-read.","Check the current mode first; toggling to an identical value is a no-op."],"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"}