{"record":{"id":"3f44c131e8a28f50","repo":"plandex-ai/plandex","slug":"invite-not-found","errorCode":null,"errorMessage":"Invite not found: ","messagePattern":"Invite not found: ","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"app/server/handlers/invites.go","lineNumber":382,"sourceCode":"\t\t\tMsg:    \"Trial user can't delete invites\",\n\t\t})\n\t\treturn\n\t}\n\n\tvars := mux.Vars(r)\n\tinviteId := vars[\"inviteId\"]\n\n\tinvite, err := db.GetInvite(inviteId)\n\n\tif err != nil {\n\t\tlog.Printf(\"Error getting invite: %v\\n\", err)\n\t\thttp.Error(w, \"Error getting invite: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif invite == nil || invite.OrgId != auth.OrgId {\n\t\tlog.Printf(\"Invite not found: %v\\n\", inviteId)\n\t\thttp.Error(w, \"Invite not found: \"+inviteId, http.StatusNotFound)\n\t\treturn\n\t}\n\n\t// ensure current user can remove target invite\n\tremovePermission := shared.Permission(strings.Join([]string{string(shared.PermissionRemoveUser), invite.OrgRoleId}, \"|\"))\n\n\tinvitePermission := shared.Permission(strings.Join([]string{string(shared.PermissionInviteUser), invite.OrgRoleId}, \"|\"))\n\n\tif !(auth.HasPermission(removePermission) ||\n\t\t(auth.User.Id == invite.InviterId && auth.HasPermission(invitePermission))) {\n\t\tlog.Printf(\"User does not have permission to remove invite with role: %v\\n\", invite.OrgRoleId)\n\t\thttp.Error(w, \"User does not have permission to remove invite with role: \"+invite.OrgRoleId, http.StatusForbidden)\n\t\treturn\n\t}\n\n\terr = db.DeleteInvite(inviteId, nil)\n\n\tif err != nil {","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/invites.go#L364-L400","documentation":"DeleteInviteHandler returns 404 'Invite not found: <inviteId>' when db.GetInvite returns nil or the invite belongs to a different org than the authenticated user. The handler intentionally does not distinguish 'never existed' from 'exists but not yours' to avoid leaking information.","triggerScenarios":"DELETE /invites/{inviteId} with an invite ID that was already deleted/accepted, a typo'd or fabricated ID, or a valid invite belonging to another org the user is not an admin of.","commonSituations":"Client retries deleting an invite that a prior request already removed; user copies an invite ID from the wrong org; stale UI listing an invite that was resolved moments ago.","solutions":["Confirm the inviteId is correct and belongs to your current org","Refresh the invite list — the invite may already be deleted or accepted","Retry with a valid invite ID from a fresh GET of the org's invites"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const invites = await listInvites(orgId)\nconst invite = invites.find(i => i.id === inviteId)\nif (!invite) throw new Error(`Invite ${inviteId} not found in org — refresh list before deleting`)","typeGuard":null,"tryCatchPattern":"try {\n\tawait client.deleteInvite(inviteId)\n} catch (e) {\n\tif (e.status === 404) { refreshInviteList(); return } // already gone\n\tthrow e\n}","preventionTips":["Always fetch the current invite list before deleting; never reuse stored IDs","Check the invite belongs to the org you're authenticated against","Treat 404 on delete as idempotent success and refresh local state"],"tags":["http-404","not-found","authorization"],"backgroundTag":"resource-not-found","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}