tinyhumansai/openhuman · warning · Error

Request timed out. Please try again.

Error message

Request timed out. Please try again.

What it means

Thrown by the magic-link flow when the AbortController wired to window.setTimeout(timeoutMs) fires and aborts the fetch, producing a DOMException/Error with name 'AbortError'. It is a client-side timeout translation: the request took longer than the configured budget and was cancelled locally — the server may never have seen it complete. The catch converts AbortError into a user-friendly retry message.

Solutions

  1. Retry the request — transient latency is the most common cause and the operation (sending an email link) is idempotent from the user's perspective.
  2. Check network/backend health if it reproducibly times out: is the backend up, does /health respond quickly?
  3. Raise timeoutMs if the backend is legitimately slow (e.g. dev environments with cold starts).
  4. Verify backendUrl is correct — a hanging (not refused) endpoint is often a wrong host/port behind a firewall.

Example fix

// before
window.setTimeout(() => controller.abort(), timeoutMs);
...
if ((error instanceof DOMException && error.name === 'AbortError') || ...) {
  throw new Error('Request timed out. Please try again.');
}

// after — retry once on timeout before giving up
async function sendWithRetry(email: string, uri: string, timeoutMs: number) {
  try {
    return await sendMagicLinkRequest(email, uri, timeoutMs);
  } catch (e) {
    if (e instanceof Error && e.message === 'Request timed out. Please try again.') {
      return await sendMagicLinkRequest(email, uri, timeoutMs); // one retry
    }
    throw e;
  }
}
Defensive patterns

Strategy: retry

Try / catch

function isTimeoutError(e: unknown): boolean {
  return e instanceof Error && e.message === 'Request timed out. Please try again.';
}

try {
  await sendMagicLink(email, uri);
} catch (e) {
  if (isTimeoutError(e)) {
    await sleep(1000);
    await sendMagicLink(email, uri); // single retry — the operation is idempotent
  } else throw e;
}

Prevention

When it happens

Trigger: Backend /auth/email/send-link is slow (cold start, email provider latency) and exceeds timeoutMs; the user is on a slow/high-latency network; backendUrl resolves to an endpoint that hangs (wrong port, firewall drop).

Common situations: First request after backend deploy (cold lambda/container); mobile/tethered connections; a mistyped backend URL that black-holes instead of refusing; timeouts set aggressively low in tests.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/c143cea1a516b161. Report an issue: GitHub.

Appendix: source

Thrown at app/src/services/api/authApi.ts:40

  try {
    const versionHeaders = await getClientVersionHeaders();
    const response = await fetch(`${backendUrl}/auth/email/send-link`, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json', ...versionHeaders },
      body: JSON.stringify({ email, frontendRedirectUri }),
      signal: controller.signal,
    });
    if (!response.ok) {
      const body = (await response.json().catch(() => ({}))) as { error?: string };
      throw new Error(body.error ?? `Failed to send magic link (${response.status})`);
    }
  } catch (error) {
    if (
      (error instanceof DOMException && error.name === 'AbortError') ||
      (error instanceof Error && error.name === 'AbortError')
    ) {
      throw new Error('Request timed out. Please try again.');
    }
    throw error;
  } finally {
    window.clearTimeout(timeoutId);
  }
}

/**
 * Consume a verified login token and return the JWT.
 * Works for both Telegram and OAuth login tokens.
 * POST /telegram/login-tokens/:token/consume (no auth required)
 */
export async function consumeLoginToken(loginToken: string): Promise<string> {
  const response = await callCoreRpc<{ result: { jwtToken: string } }>({
    method: 'openhuman.auth.consume_login_token',
    params: { loginToken },
  });
  const jwtToken = response.result?.jwtToken;

View on GitHub (pinned to 7491200858)