{"record":{"id":"10763419e72f163f","repo":"paperclipai/paperclip","slug":"this-account-already-belongs-to-the-company","errorCode":null,"errorMessage":"This account already belongs to the company.","messagePattern":"This account already belongs to the company\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ui/src/pages/InviteLanding.tsx","lineNumber":340,"sourceCode":"    error === null;\n  const sessionLabel =\n    sessionQuery.data?.user.name?.trim() ||\n    sessionQuery.data?.user.email?.trim() ||\n    \"this account\";\n\n  const authCanSubmit =\n    email.trim().length > 0 &&\n    password.trim().length > 0 &&\n    (authMode === \"sign_in\" || (name.trim().length > 0 && password.trim().length >= 8));\n\n  const acceptMutation = useMutation({\n    mutationFn: async () => {\n      if (!invite) throw new Error(\"Invite not found\");\n      if (isCheckingExistingMembership) {\n        throw new Error(\"Checking your company access. Try again in a moment.\");\n      }\n      if (isCurrentMember) {\n        throw new Error(\"This account already belongs to the company.\");\n      }\n      if (invite.inviteType === \"bootstrap_ceo\" || invite.allowedJoinTypes !== \"agent\") {\n        return accessApi.acceptInvite(token, { requestType: \"human\" });\n      }\n      return accessApi.acceptInvite(token, {\n        requestType: \"agent\",\n        agentName: agentName.trim(),\n        adapterType,\n        capabilities: capabilities.trim() || null,\n      });\n    },\n    onSuccess: async (payload) => {\n      setError(null);\n      clearPendingInviteToken(token);\n      const asBootstrap = isBootstrapAcceptancePayload(payload);\n      setResult({ kind: asBootstrap ? \"bootstrap\" : \"join\", payload });\n      await queryClient.invalidateQueries({ queryKey: queryKeys.auth.session });\n      await queryClient.invalidateQueries({ queryKey: queryKeys.access.currentBoardAccess });","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/ui/src/pages/InviteLanding.tsx#L322-L358","documentation":"Idempotency guard in the InviteLanding acceptMutation: the membership check resolved and the signed-in account is already a member of the invite's company, so re-accepting the invite is refused instead of creating a duplicate membership.","triggerScenarios":"Thrown at ui/src/pages/InviteLanding.tsx:339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Sign in with the account that already belongs to the company, or use a different account for this invite."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}