{"record":{"id":"c90bbc380dcc756e","repo":"tonhowtf/omniget","slug":"omnidisc-ducking-failed","errorCode":null,"errorMessage":"[omnidisc] ducking failed","messagePattern":"\\[omnidisc\\] ducking failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/lib/stores/omnidisc-voice-store.svelte.ts","lineNumber":713,"sourceCode":"      \"omnidisc_voice_ptt_status\",\n    );\n    pttRegistered = status.binding ? status.registered : null;\n  } catch (e) {\n    pttRegistered = null;\n    console.warn(\"[omnidisc] push-to-talk status unavailable\", errorText(e));\n  }\n}\n\nexport async function setVadThreshold(db: number): Promise<void> {\n  await updateSettings({ omnidisc: { voice: { vad_threshold_db: db } } });\n}\n\nexport async function setDucking(percent: number): Promise<void> {\n  const clamped = Math.min(100, Math.max(0, Math.round(percent)));\n  try {\n    await invoke(\"omnidisc_voice_set_ducking\", { percent: clamped });\n  } catch (e) {\n    console.warn(\"[omnidisc] ducking failed\", errorText(e));\n  }\n  await updateSettings({ omnidisc: { voice: { ducking_percent: clamped } } });\n}\n\nexport async function setRelayOnly(enabled: boolean): Promise<void> {\n  await updateSettings({ omnidisc: { voice: { relay_only: enabled } } });\n}\n\nexport function isE2ee(): boolean {\n  return session?.e2ee === true;\n}\n\nexport function pushToTalk(pressed: boolean) {\n  invoke(\"omnidisc_voice_ptt\", { pressed }).catch(() => undefined);\n}\n\nexport async function setMicTest(on: boolean): Promise<string | null> {\n  try {","sourceCodeStart":695,"sourceCodeEnd":731,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src/lib/stores/omnidisc-voice-store.svelte.ts#L695-L731","documentation":"Logged by setDucking() when `omnidisc_voice_set_ducking` fails. The percent is clamped to 0-100 before the call; on failure the ducking level on the backend is unchanged, but the new value is still persisted to settings, which can desync preference vs. reality. Non-fatal.","triggerScenarios":"Calling setDucking(percent) when the backend command rejects: ducking/attenuation not supported by the audio backend, voice session not active, or handler error.","commonSituations":"Adjusting the ducking slider while not in a voice channel; audio backend without attenuation support; command not registered; browser dev mode.","solutions":["Read errorText(e) for the backend reason.","Only persist ducking_percent when the invoke succeeds, keeping settings in sync.","Check that the audio backend supports attenuation/ducking on this platform.","Ensure the voice session is active before applying ducking, or apply on session start from saved settings.","Verify `omnidisc_voice_set_ducking` is registered and accepts { percent }."],"exampleFix":"// before\ntry {\n  await invoke(\"omnidisc_voice_set_ducking\", { percent: clamped });\n} catch (e) {\n  console.warn(\"[omnidisc] ducking failed\", errorText(e));\n}\nawait updateSettings({ omnidisc: { voice: { ducking_percent: clamped } } });\n// after\ntry {\n  await invoke(\"omnidisc_voice_set_ducking\", { percent: clamped });\n  await updateSettings({ omnidisc: { voice: { ducking_percent: clamped } } });\n} catch (e) {\n  console.warn(\"[omnidisc] ducking failed\", errorText(e));\n}","handlingStrategy":"try-catch","validationCode":"const clamped = Math.min(100, Math.max(0, Math.round(percent)));\nif (!Number.isFinite(percent)) return;","typeGuard":"function isValidPercent(p: number): boolean {\n  return Number.isFinite(p) && p >= 0 && p <= 100;\n}","tryCatchPattern":"try {\n  await invoke(\"omnidisc_voice_set_ducking\", { percent: clamped });\n  await updateSettings({ omnidisc: { voice: { ducking_percent: clamped } } });\n} catch (e) {\n  console.warn(\"[omnidisc] ducking failed\", errorText(e));\n}","preventionTips":["Persist settings only after a successful backend apply.","Clamp and round percent before invoking.","Verify ducking support in the audio backend per platform.","Apply saved ducking value when a voice session starts."],"tags":["tauri","ipc","audio","ducking"],"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"}