{"record":{"id":"3c4e011e76f8a491","repo":"AprilNEA/OpenLogi","slug":"capture-failed-with-a-host-open-disconnect-timeout","errorCode":null,"errorMessage":"capture failed with a host, open, disconnect, timeout, interruption, or non-replayable protocol error; no fixture was written","messagePattern":"capture failed with a host, open, disconnect, timeout, interruption, or non-replayable protocol error; no fixture was written","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/record_case.rs","lineNumber":174,"sourceCode":"            }),\n            Self::FirmwareEntities(Err(error))\n            | Self::ReprogrammableControls(Err(error))\n            | Self::RawBattery(Err(error))\n            | Self::DpiInfo(Err(error))\n            | Self::SmartshiftStatus(Err(error))\n            | Self::WheelMode(Err(error))\n            | Self::BacklightState(Err(error)) => replayable_error(error),\n            Self::ReprogrammableControls(Ok(_))\n            | Self::RawBattery(Ok(_))\n            | Self::DpiInfo(Ok(_))\n            | Self::SmartshiftStatus(Ok(_))\n            | Self::WheelMode(Ok(_))\n            | Self::BacklightState(Ok(_)) => true,\n        };\n        if replayable {\n            Ok(())\n        } else {\n            bail!(\n                \"capture failed with a host, open, disconnect, timeout, interruption, or \\\n                 non-replayable protocol error; no fixture was written\"\n            )\n        }\n    }\n}\n\nfn replayable_error(error: &WriteError) -> bool {\n    matches!(\n        error,\n        WriteError::FeatureUnsupported { .. }\n            | WriteError::EmptyDpiList\n            | WriteError::HidppFeature { .. }\n            | WriteError::UnsupportedResponse { .. }\n    )\n}\n\n#[derive(Clone, Debug)]","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/record_case.rs#L156-L192","documentation":"`ensure_replayable` validates that the just-recorded HID++ capture ended in a state the fixture replay machinery can reproduce. If the capture terminated via a host error, device-open failure, disconnect, timeout, interruption, or a non-replayable protocol result, the recording is discarded and this error is thrown instead of writing a fixture.","triggerScenarios":"Running `openlogi fixture record-case` when the device disconnects mid-capture, the HID open fails, a request times out, the capture is interrupted, or the recorded HID++ operation result is not one of the replayable Ok states (e.g. a feature-error protocol result).","commonSituations":"Unplugging or powering off a mouse/receiver during recording; using a flaky Bolt/Unifying receiver link; recording a command whose protocol response is an error code rather than a replayable OK; another process holding the HID device so the open fails.","solutions":["Re-run the record command with the device solidly connected (cable, or fresh receiver pairing) and let the capture finish without interruption","Verify the recorded operation is expected to succeed on this device/firmware; if it returns a protocol error, record a different case or fix the device state first","Stop competing consumers of the device (the OpenLogi agent or another CLI instance) so the open and I/O do not fail","If timeouts recur, retry on a wired connection or a less congested wireless channel"],"exampleFix":"// before (flaky wireless capture)\nopenlogi fixture record-case --name dpi-cycle   # device dropped mid-run\n// after (stable capture)\nopenlogi fixture record-case --name dpi-cycle   # wired/direct, capture completes","handlingStrategy":"retry","validationCode":"// before recording, ensure a stable device and no competing agent\nlet status = Command::new(\"openlogi\").args([\"list\"]).output()?;\nassert!(status.status.success(), \"device not reachable; fix connection before recording\");","typeGuard":null,"tryCatchPattern":"match record_case_result {\n    Err(e) if e.to_string().contains(\"no fixture was written\") => {\n        eprintln!(\"capture not replayable: {e}; re-record on a stable link\");\n    }\n    Err(e) => return Err(e.into()),\n    Ok(fixture) => use_fixture(fixture),\n}","preventionTips":["Record on a wired/direct connection when possible","Stop the OpenLogi agent before recording","Never unplug or let the device sleep during capture","Only record operations the device supports and completes successfully"],"tags":["hidpp","fixture","recording","device-io"],"backgroundTag":"device-disconnect-during-capture","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"}