{"record":{"id":"a0e998d8c3379420","repo":"tonhowtf/omniget","slug":"omnidisc-device-list-failed","errorCode":null,"errorMessage":"[omnidisc] device list failed","messagePattern":"\\[omnidisc\\] device list failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/lib/stores/omnidisc-voice-store.svelte.ts","lineNumber":642,"sourceCode":"  if (clamped === 1) {\n    const next = { ...volumes };\n    delete next[userId];\n    volumes = next;\n  } else {\n    volumes = { ...volumes, [userId]: clamped };\n  }\n  persistVolumes();\n  invoke(\"omnidisc_voice_set_volume\", { userId, gain: clamped }).catch((e: unknown) => {\n    console.warn(\"[omnidisc] volume failed\", errorText(e));\n  });\n}\n\nexport async function refreshDevices(): Promise<void> {\n  devicesLoading = true;\n  try {\n    devices = await invoke<AudioDevices>(\"omnidisc_voice_devices\");\n  } catch (e) {\n    console.warn(\"[omnidisc] device list failed\", errorText(e));\n  } finally {\n    devicesLoading = false;\n  }\n}\n\nexport async function setDevice(kind: DeviceKind, id: string | null): Promise<string | null> {\n  const key = kind === \"input\" ? \"input_device\" : \"output_device\";\n  try {\n    await invoke(\"omnidisc_voice_set_device\", { kind, id });\n  } catch (e) {\n    return errorText(e);\n  }\n  try {\n    await updateSettings({ omnidisc: { voice: { [key]: id } } });\n  } catch (e) {\n    console.warn(\"[omnidisc] device preference not saved\", errorText(e));\n  }\n  return null;","sourceCodeStart":624,"sourceCodeEnd":660,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src/lib/stores/omnidisc-voice-store.svelte.ts#L624-L660","documentation":"Logged by refreshDevices() when the `omnidisc_voice_devices` IPC command fails. The store sets devicesLoading back to false in the finally block but leaves the previous (possibly empty) devices list, so the device picker shows stale data. Non-fatal.","triggerScenarios":"Calling refreshDevices() when enumerating audio devices on the backend fails: no audio subsystem available, OS device enumeration error, or command not registered in Tauri.","commonSituations":"Running on a machine/CI/container with no audio devices; audio driver crash; headless Linux without PulseAudio/PipeWire; browser dev mode without Tauri IPC.","solutions":["Check errorText(e) for the OS-level enumeration error.","Verify an audio server (PulseAudio/PipeWire/CoreAudio) is running and devices exist.","Confirm `omnidisc_voice_devices` is registered in the Tauri invoke handler.","Retry the enumeration; transient device hotplug can cause failures.","Keep showing cached device list and offer a manual refresh button when this fails."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (!isTauri()) return; // skip device enumeration outside the webview","typeGuard":"function isTauri(): boolean {\n  return typeof window !== \"undefined\" && \"__TAURI_INTERNALS__\" in window;\n}","tryCatchPattern":"try {\n  devices = await invoke<AudioDevices>(\"omnidisc_voice_devices\");\n} catch (e) {\n  console.warn(\"[omnidisc] device list failed\", errorText(e));\n  // keep stale devices list; offer manual refresh\n} finally {\n  devicesLoading = false;\n}","preventionTips":["Always reset loading flags in finally.","Keep the previous device list on failure instead of clearing it.","Check for an audio server (PulseAudio/PipeWire) on Linux before debugging.","Retry enumeration after device hotplug events."],"tags":["tauri","ipc","audio-devices"],"backgroundTag":"api-request-failed","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}