{"record":{"id":"2f801ebb325552b6","repo":"tonhowtf/omniget","slug":"omnidisc-could-not-subscribe-to-call-rings","errorCode":null,"errorMessage":"[omnidisc] could not subscribe to call rings","messagePattern":"\\[omnidisc\\] could not subscribe to call rings","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/stores/omnidisc-voice-store.svelte.ts","lineNumber":504,"sourceCode":"      } catch (e) {\n        console.warn(\"[omnidisc] voice event failed\", errorText(e));\n      }\n    });\n  } catch (e) {\n    initialized = false;\n    console.warn(\"[omnidisc] could not subscribe to voice events\", errorText(e));\n    return;\n  }\n  try {\n    unlistenDispatch = await listen<DispatchPayload>(\"omnidisc://dispatch\", (event) => {\n      try {\n        handleDispatch(event.payload);\n      } catch (e) {\n        console.warn(\"[omnidisc] call ring failed\", errorText(e));\n      }\n    });\n  } catch (e) {\n    console.warn(\"[omnidisc] could not subscribe to call rings\", errorText(e));\n  }\n  try {\n    applyStatus(await invoke<VoiceStatusWire>(\"omnidisc_voice_status\"));\n  } catch {\n    return;\n  }\n}\n\nexport function teardownVoice() {\n  if (unlisten) unlisten();\n  unlisten = null;\n  if (unlistenDispatch) unlistenDispatch();\n  unlistenDispatch = null;\n  initialized = false;\n  if (statsTimer) clearInterval(statsTimer);\n  statsTimer = null;\n  if (ringTimer) clearInterval(ringTimer);\n  ringTimer = null;","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src/lib/stores/omnidisc-voice-store.svelte.ts#L486-L522","documentation":"During voice init, subscribing to the `omnidisc://dispatch` channel (call rings) via listen() can itself reject. Unlike the voice channel failure, this one is non-fatal: the warning is logged and init continues to fetch `omnidisc_voice_status`. Result: the session works but incoming-call rings are silently never delivered.","triggerScenarios":"listen(\"omnidisc://dispatch\") rejecting because the IPC/event layer is unavailable, the backend never registered that topic, or a prior listen teardown raced the new subscription.","commonSituations":"Partial backend build missing the dispatch emitter; init running in a non-Tauri test harness; event system briefly unavailable at startup so voice works but rings are lost until re-init.","solutions":["Retry the dispatch subscription with backoff instead of swallowing the failure.","Verify the backend emits on `omnidisc://dispatch`; check the Rust setup/emit code for the exact topic string.","Track a dispatchConnected flag and surface 'incoming calls unavailable' in the UI when false.","Gate init on the Tauri runtime to avoid subscribe attempts outside the webview."],"exampleFix":"// before\nunlistenDispatch = await listen<DispatchPayload>(\"omnidisc://dispatch\", ...);\n// after\ntry {\n  unlistenDispatch = await listen<DispatchPayload>(\"omnidisc://dispatch\", ...);\n  dispatchConnected = true;\n} catch (e) {\n  dispatchConnected = false;\n  scheduleDispatchRetry();\n}","handlingStrategy":"retry","validationCode":"if (!('__TAURI_INTERNALS__' in window)) { dispatchConnected = false; return; }","typeGuard":null,"tryCatchPattern":"try {\n  unlistenDispatch = await listen<DispatchPayload>(\"omnidisc://dispatch\", onDispatch);\n  dispatchConnected = true;\n} catch (e) {\n  dispatchConnected = false;\n  console.warn(\"[omnidisc] could not subscribe to call rings\", errorText(e));\n  scheduleDispatchRetry();\n}","preventionTips":["Track subscription success in a flag and retry failed subscriptions in the background.","Confirm the backend emits on the exact `omnidisc://dispatch` topic.","Surface degraded mode ('incoming calls unavailable') instead of failing silently.","Gate init on the Tauri runtime to avoid futile subscribe attempts."],"tags":["tauri","events","subscription","dispatch"],"backgroundTag":"event-subscribe-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"}