{"record":{"id":"866a072c9f84b320","repo":"diegosouzapw/OmniRoute","slug":"t-tokensrevokeinvitefailed","errorCode":null,"errorMessage":"t(\"tokensRevokeInviteFailed\")","messagePattern":"t\\(\"tokensRevokeInviteFailed\"\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/tokens/page.tsx","lineNumber":186,"sourceCode":"        setNewInviteCode(data.code);\n        await fetchData();\n      } else {\n        setInviteError(data.error || t(\"tokensCreateInviteFailed\"));\n      }\n    } catch (error) {\n      setInviteError(error instanceof Error ? error.message : t(\"tokensCreateInviteFailed\"));\n    } finally {\n      setInviteLoading(false);\n    }\n  };\n\n  const handleRevokeInvite = async (inviteId: string) => {\n    setInviteError(\"\");\n    try {\n      const response = await fetch(`/api/gamification/invite?id=${inviteId}`, {\n        method: \"DELETE\",\n      });\n      if (!response.ok) throw new Error(t(\"tokensRevokeInviteFailed\"));\n      await fetchData();\n    } catch (error) {\n      setInviteError(error instanceof Error ? error.message : t(\"tokensRevokeInviteFailed\"));\n    }\n  };\n\n  const handleRedeem = async (e: React.FormEvent) => {\n    e.preventDefault();\n    setRedeemLoading(true);\n    setRedeemMsg(null);\n\n    try {\n      const res = await fetch(\"/api/gamification/invite/redeem\", {\n        method: \"POST\",\n        headers: { \"Content-Type\": \"application/json\" },\n        body: JSON.stringify({ code: redeemCode, apiKeyId: \"current\" }),\n      });\n      const data = await res.json();","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/tokens/page.tsx#L168-L204","documentation":"Localized sentinel thrown when revoking an invite code fails: the DELETE to /api/gamification/invite?id=<inviteId> returned non-ok. The invite remains active; the fixed 'tokensRevokeInviteFailed' string carries no detail — the actual cause (auth, already-revoked invite, gamification store error) is in the response body or server logs.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/tokens/page.tsx:186 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the DELETE status/body — 404 means the invite was already revoked","Confirm the gamification invite feature is enabled","Refresh the invite list and retry if still present"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}