Skip to content

Commit 24dbb4f

Browse files
msukkariclaude
andcommitted
fix(web): re-enable Add connector button without waiting on background refetch
The "Add connector" button stayed disabled for 2-3s after creating a connector because the create handler awaited invalidateMcpConfigurationQueries, which blocks on refetching the server-status and tools queries (network round-trips to the MCP servers). Fire those invalidations in the background (void) so the button re-enables as soon as creation succeeds, matching the fire-and-forget invalidation pattern used elsewhere in the codebase. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a009461 commit 24dbb4f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

packages/web/src/app/(app)/settings/workspaceAskAgent/workspaceAskAgentPage.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ export function WorkspaceAskAgentPage({ callbackStatus, callbackServer, callback
293293
return;
294294
}
295295

296-
await invalidateMcpConfigurationQueries(queryClient);
296+
// Fire-and-forget: the server list / connection status / tools queries
297+
// refetch in the background (some hit the MCP servers over the network and
298+
// take a couple seconds). Don't block re-enabling the button on them.
299+
void invalidateMcpConfigurationQueries(queryClient);
297300
handleCloseClientCredentialsDialog();
298301
} catch {
299302
toast({ title: "Error", description: "Failed to add connector.", variant: "destructive" });
@@ -339,7 +342,9 @@ export function WorkspaceAskAgentPage({ callbackStatus, callbackServer, callback
339342
return;
340343
}
341344

342-
await invalidateMcpConfigurationQueries(queryClient);
345+
// Fire-and-forget: see note in the static-OAuth path above. Re-enabling the
346+
// button shouldn't wait on the background status/tools refetch.
347+
void invalidateMcpConfigurationQueries(queryClient);
343348
onSuccess?.();
344349
} catch (error) {
345350
toast({ title: "Error", description: `Failed to add connector: ${error}`, variant: "destructive" });

0 commit comments

Comments
 (0)