{"record":{"id":"6016d4d957621b92","repo":"different-ai/openwork","slug":"failed-to-update-connection-access-response-sta","errorCode":null,"errorMessage":"Failed to update connection access (${response.status}).","messagePattern":"Failed to update connection access \\((.+?)\\)\\.","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx","lineNumber":863,"sourceCode":"    },\n  });\n}\n\nexport function useReplaceMcpConnectionAccess() {\n  const queryClient = useQueryClient();\n  const { orgId, runReauthableAction } = useOrgDashboard();\n\n  return useMutation({\n    mutationFn: async (input: { connectionId: string; access: McpConnectionAccessInput }): Promise<string> => {\n      let result: string | null = null;\n      await runReauthableAction(\"replace-mcp-connection-access\", async () => {\n        const { response, payload } = await requestJson(\n          `/v1/mcp-connections/${encodeURIComponent(input.connectionId)}/access`,\n          { method: \"PUT\", headers: getOrgScopeHeaders(requireOrgId(orgId)), body: JSON.stringify({ access: input.access }) },\n          15000,\n        );\n        if (!response.ok) {\n          throw getRequestError(payload, response, `Failed to update connection access (${response.status}).`);\n        }\n        result = input.connectionId;\n      });\n      if (!result) throw new Error(\"Update connection access response was incomplete.\");\n      return result;\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries({ queryKey: mcpConnectionQueryKeys.all });\n    },\n  });\n}\n\nexport function useStartMcpConnectionOAuth() {\n  const { orgId } = useOrgDashboard();\n\n  return useMutation({\n    mutationFn: async (connectionId: string): Promise<{ status: \"connected\" | \"needs_auth\"; authorizeUrl: string | null }> => {\n      const { response, payload } = await requestJson(","sourceCodeStart":845,"sourceCodeEnd":881,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx#L845-L881","documentation":"Error \"Failed to update connection access (${response.status}).\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/apps/den-web/app/(den)/dashboard/_components/mcp-connections-data.tsx:863 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"}