tonhowtf/omniget · warning

[omnidisc] could not sign out of

Error message

[omnidisc] could not sign out of

What it means

During forgetRemote (invoked by removeInstance), the store attempts to disconnect the gateway and log the user out on the backend via two invoke() calls (`omnidisc_gateway_disconnect`, `omnidisc_logout`). If either backend command rejects — the instance is already unreachable, the session/token is already gone, or the backend command errors — the catch block logs a warning that sign-out failed. The local instance removal continues regardless; only server-side sign-out was skipped.

Solutions

  1. Check the logged errorText(e) to see which invoke failed and why (network vs auth vs missing command)
  2. Verify the Tauri backend registers `omnidisc_gateway_disconnect` and `omnidisc_logout` handlers
  3. Confirm the instance URL is reachable; if the server is gone, treat failed sign-out as acceptable and proceed with local removal
  4. Clear stale credentials/instance state locally after repeated sign-out failures
Defensive patterns

Strategy: try-catch

Validate before calling

// before removing
if (!instances.some((i) => i.url === url)) return;

Try / catch

try {
  await invoke("omnidisc_gateway_disconnect", { url });
  await invoke("omnidisc_logout", { url });
} catch (e) {
  console.warn("[omnidisc] could not sign out of", url, errorText(e));
  // proceed with local removal anyway
}

Prevention

When it happens

Trigger: Calling removeInstance(id) → forgetRemote(url) when the backend `omnidisc_gateway_disconnect` or `omnidisc_logout` command rejects: gateway socket already closed, instance server offline, invalid/expired stored session token, or command not registered in the backend.

Common situations: Removing an instance whose server has been taken down; stale auth tokens after server restart or password change; testing demo/local setups where no real backend endpoint exists; version mismatch where the Tauri command was renamed.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/877b1cd0028815c7. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/stores/omnidisc-store.svelte.ts:367

  clearInstanceData(id);
  instances = instances.filter((i) => i.id !== id);
  if (selectedInstanceId === id) {
    selectedInstanceId = instances[0]?.id ?? null;
    selectedGuildId = null;
    selectedChannelId = null;
  }
  persist();
  if (instance && !isDemo(id)) {
    void forgetRemote(instance.url);
  }
}

async function forgetRemote(url: string) {
  try {
    await invoke("omnidisc_gateway_disconnect", { url });
    await invoke("omnidisc_logout", { url });
  } catch (e) {
    console.warn("[omnidisc] could not sign out of", url, errorText(e));
  }
}

export async function signOut(id: string) {
  const instance = instances.find((i) => i.id === id);
  if (!instance || isDemo(id)) return;
  try {
    await invoke("omnidisc_logout", { url: instance.url });
  } catch {
    // token is dropped locally even if the server did not answer
  }
  clearInstanceData(id);
  setInstanceStatus(id, "signed_out");
}

export function setInstanceStatus(id: string, status: InstanceStatus, error?: string) {
  const instance = instances.find((i) => i.id === id);
  if (!instance) return;

View on GitHub (pinned to 8600b91f42)