tonhowtf/omniget · warning

[omnidisc] invite could not be redeemed

Error message

[omnidisc] invite could not be redeemed

What it means

After connecting to an instance with a pending invite, the store calls `omnidisc_join_invite` on the backend to redeem the invite code. If redemption fails, the warning is logged, the guild is not upserted, but the connection still completes (`connectedInstance = instance; connectStep = "done"`) — the user is connected but did not join the invited guild.

Solutions

  1. Read errorText(e) for the server's join rejection reason (invalid/expired code, banned, already member)
  2. Verify the invite code is current — generate a fresh invite on the target server
  3. Check that parseGuild handles the backend's response shape; if the raw response is valid, fix the parser
  4. After fixing, re-run the join explicitly rather than reconnecting the whole instance
Defensive patterns

Strategy: try-catch

Validate before calling

// sanity-check the invite before joining
const code = pending.invite?.trim();
if (!code || !/^[A-Za-z0-9-]+$/.test(code)) return;

Try / catch

try {
  const raw = await invoke("omnidisc_join_invite", { url, code });
  const guild = parseGuild(raw, instance.id);
  if (guild) upsertGuild(instance.id, guild);
} catch (e) {
  console.warn("[omnidisc] invite could not be redeemed", errorText(e));
  // let connection complete; prompt user to retry the invite
}

Prevention

When it happens

Trigger: Connecting via an invite link when `omnidisc_join_invite` rejects: the invite code is expired/revoked/invalid, the user lacks permission to join, the server rejects the join, or the response fails parseGuild so no guild is returned.

Common situations: Sharing invite links after they expired; already being a member (some servers error on re-join); banned from the target guild; typo'd or truncated invite code in a copied link; instance API changed its join response shape.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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

Appendix: source

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

    streaming: pending.streaming,
    insecure: pending.insecure,
  });
  selectedInstanceId = instance.id;
  connectStep = "syncing";
  try {
    await connectGateway(instance);
    if (instance.status !== "connected") await waitForReady(pending.url);
  } catch (e) {
    failConnect(e);
    return null;
  }
  if (joinInvite && pending.invite) {
    try {
      const raw = await invoke<unknown>("omnidisc_join_invite", { url: pending.url, code: pending.invite });
      const guild = parseGuild(raw, instance.id);
      if (guild) upsertGuild(instance.id, guild);
    } catch (e) {
      console.warn("[omnidisc] invite could not be redeemed", errorText(e));
    }
  }
  connectedInstance = instance;
  connectStep = "done";
  return instance;
}

export async function connectInstance(url: string, invite?: string): Promise<OmnidiscInstance | null> {
  ensureLoaded();
  connectStep = "connecting";
  connectError = null;
  connectedInstance = null;
  pendingConnect = null;
  let result: ConnectResult;
  try {
    result = await invoke<ConnectResult>("omnidisc_connect", {
      url,
      invite: invite && invite.trim().length > 0 ? invite.trim() : null,

View on GitHub (pinned to 8600b91f42)