{"record":{"id":"59b937955a00fa25","repo":"tonhowtf/omniget","slug":"omnidisc-mute-failed","errorCode":null,"errorMessage":"[omnidisc] mute failed","messagePattern":"\\[omnidisc\\] mute failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/lib/stores/omnidisc-voice-store.svelte.ts","lineNumber":606,"sourceCode":"    outputError = null;\n    syncStatsPolling();\n  }\n}\n\nexport async function retryVoice(): Promise<boolean> {\n  const target = session?.channelId;\n  if (!target) return false;\n  return joinVoice(target);\n}\n\nexport async function toggleMute(): Promise<void> {\n  const next = !muted;\n  muted = next;\n  try {\n    applyStatus(await invoke<VoiceStatusWire>(\"omnidisc_voice_set_mute\", { muted: next }));\n  } catch (e) {\n    muted = !next;\n    console.warn(\"[omnidisc] mute failed\", errorText(e));\n  }\n}\n\nexport async function toggleDeafen(): Promise<void> {\n  const next = !deafened;\n  deafened = next;\n  try {\n    applyStatus(await invoke<VoiceStatusWire>(\"omnidisc_voice_set_deaf\", { deafened: next }));\n  } catch (e) {\n    deafened = !next;\n    console.warn(\"[omnidisc] deafen failed\", errorText(e));\n  }\n}\n\nexport function setVolume(userId: string, gain: number) {\n  loadVolumes();\n  const clamped = Math.min(2, Math.max(0, Number.isFinite(gain) ? gain : 1));\n  if (clamped === 1) {","sourceCodeStart":588,"sourceCodeEnd":624,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src/lib/stores/omnidisc-voice-store.svelte.ts#L588-L624","documentation":"This warning is logged by omnidisc-voice-store's toggleMute when the Tauri IPC command `omnidisc_voice_set_mute` rejects. The store optimistically flips the local `muted` flag, calls the backend, and rolls the flag back if the backend call fails, so UI state stays consistent. It is a non-fatal warning: the app keeps running but the mute did not take effect on the voice backend.","triggerScenarios":"Calling toggleMute() when the Tauri backend command `omnidisc_voice_set_mute` returns an error: backend not running/initialized, voice session not started, audio subsystem failure, or the command rejected with a Rust error (e.g. poisoned mutex, audio device unavailable).","commonSituations":"Voice session torn down while user clicks the mute button; audio daemon/device disconnected; Tauri command handler panicked or returned Err; running the frontend in a browser (no Tauri IPC) during dev.","solutions":["Check the errorText(e) payload in the console to see the backend's error message and fix the root cause there.","Ensure the voice session is connected/started before toggling mute; gate the button on connection state.","Verify the `omnidisc_voice_set_mute` command is registered in the Tauri builder and its Rust handler returns Result.","Test on a machine with a working audio input device; mute may fail when no capture device exists.","In browser dev mode, expect all invoke() calls to fail; test inside the Tauri app instead."],"exampleFix":"// before\nmuted = next;\ntry {\n  applyStatus(await invoke<VoiceStatusWire>(\"omnidisc_voice_set_mute\", { muted: next }));\n} catch (e) {\n  muted = !next;\n  console.warn(\"[omnidisc] mute failed\", errorText(e));\n}\n// after\nif (!connected) return; // don't attempt mute without an active voice session\nmuted = next;\ntry {\n  applyStatus(await invoke<VoiceStatusWire>(\"omnidisc_voice_set_mute\", { muted: next }));\n} catch (e) {\n  muted = !next;\n  notifyUser(\"Could not change mute: \" + errorText(e));\n  console.warn(\"[omnidisc] mute failed\", errorText(e));\n}","handlingStrategy":"try-catch","validationCode":"// caller-side\nif (!get(voiceConnected)) throw new Error(\"voice session not active\");","typeGuard":"function isTauri(): boolean {\n  return typeof window !== \"undefined\" && \"__TAURI_INTERNALS__\" in window;\n}","tryCatchPattern":"try {\n  applyStatus(await invoke<VoiceStatusWire>(\"omnidisc_voice_set_mute\", { muted: next }));\n} catch (e) {\n  muted = !next; // roll back optimistic state\n  console.warn(\"[omnidisc] mute failed\", errorText(e));\n}","preventionTips":["Gate mute/deafen controls on an active voice connection.","Always roll back optimistic local state in the catch block.","Test voice commands inside the Tauri app, not a plain browser.","Log errorText(e) and alert on repeated failures to catch backend regressions early."],"tags":["tauri","ipc","audio","voice"],"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-15T23:17:13.987Z"}