{"record":{"id":"5052824cd3527f2c","repo":"different-ai/openwork","slug":"failed-to-disconnect-account-response-status","errorCode":null,"errorMessage":"Failed to disconnect account (${response.status}).","messagePattern":"Failed to disconnect account \\((.+?)\\)\\.","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx","lineNumber":917,"sourceCode":"  });\n}\n\nexport function useDisconnectMyProviderAccount() {\n  const queryClient = useQueryClient();\n  const { orgId } = useOrgDashboard();\n\n  return useMutation({\n    mutationFn: async (connection: Pick<ExternalMcpConnection, \"id\" | \"nativeProviderKey\">): Promise<string> => {\n      const path = isNativeProviderConnectionId(connection.id, connection.nativeProviderKey)\n        ? `/v1/oauth-providers/${encodeURIComponent(connection.id)}/disconnect`\n        : `/v1/mcp-connections/${encodeURIComponent(connection.id)}/disconnect-my-account`;\n      const { response, payload } = await requestJson(\n        path,\n        { method: \"POST\", headers: getOrgScopeHeaders(requireOrgId(orgId)) },\n        15000,\n      );\n      if (!response.ok) {\n        throw getRequestError(payload, response, `Failed to disconnect account (${response.status}).`);\n      }\n      return connection.id;\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries({ queryKey: mcpConnectionQueryKeys.all });\n    },\n  });\n}\n\nexport function useDisconnectMcpConnection() {\n  const queryClient = useQueryClient();\n  const { orgId, runReauthableAction } = useOrgDashboard();\n\n  return useMutation({\n    mutationFn: async (connectionId: string): Promise<string> => {\n      let result: string | null = null;\n      await runReauthableAction(\"disconnect-mcp-connection\", async () => {\n        const { response, payload } = await requestJson(","sourceCodeStart":899,"sourceCodeEnd":935,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx#L899-L935","documentation":"Error \"Failed to disconnect account (${response.status}).\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx:917 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}