{"record":{"id":"2b9eef372afe9342","repo":"AprilNEA/OpenLogi","slug":"the-selected-direct-capture-target-does-not-match-the","errorCode":null,"errorMessage":"the selected direct-capture target does not match the profile transport and slot; reconnect the same device and use the same --device selector","messagePattern":"the selected direct-capture target does not match the profile transport and slot; reconnect the same device and use the same --device selector","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/contribute.rs","lineNumber":438,"sourceCode":"            DeviceRoute::RawHid {\n                vendor_id: right_vendor,\n                product_id: right_product,\n                usage_page: right_page,\n                usage_id: right_usage,\n                ..\n            },\n        ) => {\n            left_vendor == right_vendor\n                && left_product == right_product\n                && left_page == right_page\n                && left_usage == right_usage\n        }\n        _ => false,\n    };\n    if matches {\n        Ok(())\n    } else {\n        bail!(\n            \"the selected direct-capture target does not match the profile transport and slot; \\\n             reconnect the same device and use the same --device selector\"\n        )\n    }\n}\n\nfn validate_args(args: &ContributeArgs) -> Result<()> {\n    if args.id.trim().is_empty() || matches!(args.id.as_str(), \".\" | \"..\") {\n        bail!(\"--id must be a nonempty synthetic path component\");\n    }\n    if Path::new(&args.id).file_name() != Some(OsStr::new(&args.id))\n        || args.id.contains('/')\n        || args.id.contains('\\\\')\n    {\n        bail!(\"--id must be one synthetic path component without separators\");\n    }\n    if args.name.trim().is_empty() {\n        bail!(\"--name must be a nonempty synthetic device name\");","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/contribute.rs#L420-L456","documentation":"When finishing a contribution, `require_same_structural_route` compares the route of the currently selected device against the route recorded in the resumable profile, ignoring only receiver identity (UID/serial) but requiring the transport kind, slot, and for Direct/RawHid the vendor/product (and usage page/id) to match. A mismatch means the user reconnected a different device or used a different `--device` selector than in the original capture, which would mix identity material from two devices; the run is aborted.","triggerScenarios":"Resuming `openlogi fixture contribute` (or finishing capture) after the device moved to a different receiver slot, was reconnected via a different transport (e.g. Bluetooth instead of the receiver, receiver instead of wired), or a different `--device` selector matched a device with different VID/PID/usage than the recorded profile.","commonSituations":"Unplugging and replugging the device into a different receiver slot or port between capture sessions; switching the device between Bolt/Unifying receiver and Bluetooth-direct; passing a numeric index to `--device` that now resolves to a different device after replug; capturing multiple similar devices (same vendor, different model/PID) and selecting the wrong one on resume.","solutions":["Reconnect the exact same device in the same way as the original capture (same transport: receiver slot, Bluetooth, or wired)","Use the same `--device` selector value as the original run — prefer a stable selector (VID:PID or serial) over a mutable numeric index","Check `openlogi list` to confirm the device's current route matches the profile, then rerun the contribution","If the setup legitimately changed, delete the resumable state and restart the contribution from scratch with the new device/transport"],"exampleFix":"// before: device moved to another receiver slot between sessions\n$ openlogi fixture contribute --id my-fixture --device 2 --output output/my-fixture\nError: the selected direct-capture target does not match the profile transport and slot; ...\n// after: same device, same slot, same selector\n$ openlogi list   # confirm device is back on the original slot/route\n$ openlogi fixture contribute --id my-fixture --device 1 --output output/my-fixture","handlingStrategy":"validation","validationCode":"// Compare structural routes (transport + slot + vid/pid) before resuming\nfn structural_matches(expected: &DeviceRoute, actual: &DeviceRoute) -> bool {\n    use DeviceRoute::*;\n    match (expected, actual) {\n        (Bolt { slot: a, .. }, Bolt { slot: b }) => a == b,\n        (Unifying { slot: a, .. }, Unifying { slot: b }) => a == b,\n        (Direct { vendor_id: v1, product_id: p1 }, Direct { vendor_id: v2, product_id: p2 }) => {\n            v1 == v2 && p1 == p2\n        }\n        (RawHid { vendor_id: v1, product_id: p1, .. }, RawHid { vendor_id: v2, product_id: p2, .. }) => {\n            v1 == v2 && p1 == p2\n        }\n        _ => false,\n    }\n}","typeGuard":null,"tryCatchPattern":"match resume_result {\n    Err(e) if e.to_string().contains(\"does not match the profile transport and slot\") => {\n        eprintln!(\"reconnect the same device / reuse the original --device selector\");\n    }\n    other => other?,\n}","preventionTips":["Record the device's stable selector (VID:PID or serial) at first capture and always reuse it for `--device`","Avoid numeric `--device` indexes, which shift after replugs; prefer explicit VID:PID selectors","Keep the device on the same receiver slot / transport for the whole contribution; don't move it mid-session","Run `openlogi list` and compare the current route to the profile before resuming a contribution"],"tags":["fixtures","hid","cli","route-mismatch"],"backgroundTag":"invalid-state-transition","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"}