{"record":{"id":"b0d5243e59f6074b","repo":"Kong/insomnia","slug":"failed-to-fetch-member-roles","errorCode":null,"errorMessage":"Failed to fetch member roles","messagePattern":"Failed to fetch member roles","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/ui/components/modals/invite-modal/invite-modal.tsx","lineNumber":705,"sourceCode":"    );\n  }\n  return null;\n};\n\nfunction checkPermissionRefType(\n  permissionRef: MutableRefObject<Record<Permission, boolean> | undefined>,\n): permissionRef is MutableRefObject<Record<Permission, boolean>> {\n  return Boolean(permissionRef.current);\n}\n\n/** Get current user's role in an organization */\nexport async function getCurrentUserRoleInOrg(organizationId: string): Promise<Role> {\n  return getOrganizationMemberRoles({\n    organizationId,\n    sessionId: await getCurrentSessionId(),\n    userId: await getAccountId(),\n  }).catch(() => {\n    throw new Error('Failed to fetch member roles');\n  });\n}\n\nasync function unlinkTeam(organizationId: string, collaboratorId: string) {\n  try {\n    return await unlinkCollaborator({\n      organizationId,\n      collaboratorId,\n      sessionId: await getCurrentSessionId(),\n    });\n  } catch (error) {\n    throw new Error(error ?? 'Failed to unlink team from organization');\n  }\n}\n\nasync function revokeOrganizationInvite(organizationId: string, invitationId: string) {\n  try {\n    return revokeInvitation({","sourceCodeStart":687,"sourceCodeEnd":723,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/ui/components/modals/invite-modal/invite-modal.tsx#L687-L723","documentation":"Sentinel error thrown by getCurrentUserRoleInOrg: the backend call getOrganizationMemberRoles (which resolves the current user's role in an organization) failed for any reason — network, auth/session expiry, or API error — and the original cause is discarded in favor of this generic message.","triggerScenarios":"Thrown at packages/insomnia/src/ui/components/modals/invite-modal/invite-modal.tsx:705 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-sign in to refresh the session, then retry the invite modal","Check connectivity to the Insomnia backend API","Inspect the network layer for the underlying getOrganizationMemberRoles failure, since this wrapper hides the original error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","contentChangedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}