{"record":{"id":"726d1eaed93da9ba","repo":"koala73/worldmonitor","slug":"checkout-timed-out-please-try-again","errorCode":null,"errorMessage":"Checkout timed out. Please try again.","messagePattern":"Checkout timed out\\. Please try again\\.","errorType":"error_code","errorClass":"ConvexError","httpStatus":null,"severity":"error","filePath":"convex/payments/checkout.ts","lineNumber":516,"sourceCode":"    if (blocking) {\n      throw new ConvexError(buildBlockedCheckoutPayload(blocking));\n    }\n    if (pending) {\n      throw new ConvexError(buildPendingBlockedPayload(pending));\n    }\n\n    const customerName = identity\n      ? [identity.givenName, identity.familyName].filter(Boolean).join(\" \") ||\n        identity.name\n      : undefined;\n\n    const result = await _createCheckoutSession(ctx, args, {\n      userId,\n      email: identity?.email,\n      name: customerName,\n    });\n    if (isCheckoutTimedOutOutcome(result)) {\n      throw new ConvexError({\n        code: result.code,\n        message: \"Checkout timed out. Please try again.\",\n      });\n    }\n    // The public Convex action historically rejects provider failures. Keep\n    // that error-channel contract: only the trusted internal relay consumes\n    // the typed outcome and translates it into HTTP 429 + Retry-After.\n    if (isCheckoutRateLimitedOutcome(result)) {\n      throw new ConvexError({\n        code: CHECKOUT_RATE_LIMITED,\n        message: \"Checkout is temporarily rate limited. Retry shortly.\",\n        retryAfterSeconds: result.retryAfterSeconds,\n      });\n    }\n    return result;\n  },\n});\n","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/koala73/worldmonitor/blob/e586b8b4b80f595aa7ece295eec10d76f2921240/convex/payments/checkout.ts#L498-L534","documentation":"The checkout Convex action calls _createCheckoutSession and, when the outcome indicates a timeout, throws a ConvexError with code and the user-facing message 'Checkout timed out. Please try again.'. The payment provider did not return a session within the allowed window, so the checkout is aborted with a retryable error rather than a partial session.","triggerScenarios":"Invoking the checkout action when the payment provider (e.g. Stripe) is slow or unresponsive and _createCheckoutSession resolves with a timeout outcome (isCheckoutTimedOutOutcome true).","commonSituations":"Payment provider outage or degraded performance; network latency between the Convex backend and the provider; very high checkout traffic; stale provider API keys causing hanging requests.","solutions":["Retry the checkout after a short delay; the message explicitly invites a retry.","Check the payment provider's status page for an ongoing incident.","Verify provider API keys and network egress from the Convex environment.","If timeouts persist, inspect provider latency and consider increasing the internal timeout budget or adding fallback provider config."],"exampleFix":"// before\nawait ctx.runMutation(api.payments.checkout.createCheckoutSession, args); // throws on provider slowness\n// after\ntry {\n  await createCheckout(args);\n} catch (e) {\n  if (isCheckoutTimedOut(e)) await delay(1000), await createCheckout(args);\n  else throw e;\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await checkout(args); } catch (e) {\n  const msg = e?.data?.message ?? e?.message;\n  if (typeof msg === 'string' && msg.includes('Checkout timed out')) {\n    await sleep(1500); return checkout(args); // bounded retries\n  }\n  throw e;\n}","preventionTips":["Implement bounded retry with backoff around checkout calls","Monitor payment provider status pages and alert on incidents","Verify provider credentials and region endpoints during setup","Set client-side timeouts aligned with the backend's provider timeout"],"tags":["payments","timeout","checkout","retryable"],"backgroundTag":"request-timeout","analyzedSha":"e586b8b4b80f595aa7ece295eec10d76f2921240","analyzedAt":"2026-09-22T01:50:49.965Z","contentChangedAt":"2026-09-22T01:50:49.965Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}