{"record":{"id":"b47666e1942aa95a","repo":"moeru-ai/airi","slug":"the-dualsense-connection-type-is-unknown","errorCode":null,"errorMessage":"The DualSense connection type is unknown.","messagePattern":"The DualSense connection type is unknown\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/input-playstation-dualsense-5/src/output-report.ts","lineNumber":37,"sourceCode":"export function buildDualSenseOutputReport(\n  connectionType: DualSenseConnectionType,\n  output: DualSenseOutputState,\n  sequenceNumber = 1,\n): DualSenseOutputReport {\n  if (connectionType === 'unknown')\n    throw new Error('The DualSense connection type is unknown.')\n\n  const reportId = connectionType === 'bluetooth' ? 0x31 : 0x02\n  const data = new Uint8Array(connectionType === 'bluetooth' ? 77 : 47)\n  const commonOffset = connectionType === 'bluetooth' ? 2 : 0\n  const common = new DataView(data.buffer, commonOffset, 47)","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/moeru-ai/airi/blob/9c213115f8bd0fff9e6eabab02b077ac32da21be/packages/input-playstation-dualsense-5/src/output-report.ts#L19-L55","documentation":"buildDualSenseOutputReport must pick a report layout (reportId 0x02/47-byte USB vs 0x31/77-byte Bluetooth with checksum) from connectionType. The sentinel guard rejects 'unknown' — the value detectDualSenseConnectionType produces when the HID report descriptor matches neither known transport — because there is no correct byte layout to emit for an unrecognized transport.","triggerScenarios":"Thrown at packages/input-playstation-dualsense-5/src/output-report.ts:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the controller was constructed via DualSenseController so detectDualSenseConnectionType ran on a verified DualSense device; an 'unknown' type usually means the device passed manual construction without verification.","Update the connection-type detection (vendor/product IDs, descriptor checks in web-hid.ts) if a new DualSense hardware revision reports an unexpected descriptor.","In UI, hide or disable rumble/lightbar controls when `controller.connectionType === 'unknown'` instead of sending."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c213115f8bd0fff9e6eabab02b077ac32da21be","analyzedAt":"2026-09-02T04:27:24.639Z","contentChangedAt":"2026-09-02T04:27:24.639Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}