Skip to content

Commit 8310051

Browse files
waleedlatif1claude
andcommitted
fix(mcp): strip oauthClientSecret from optimistic cache update
The useUpdateMcpServer optimistic update was spreading the raw updates object into the TanStack Query cache, which briefly placed the plaintext oauthClientSecret in client-side cache. Strip it from the optimistic spread — the cache holds the server-sanitized record after onSettled invalidation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 759626c commit 8310051

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/sim/hooks/queries/mcp.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,12 @@ export function useUpdateMcpServer() {
269269
)
270270

271271
if (previousServers) {
272+
const { oauthClientSecret: _omitSecret, ...safeUpdates } = updates
272273
queryClient.setQueryData<McpServer[]>(
273274
mcpKeys.serversList(workspaceId),
274275
previousServers.map((server) =>
275276
server.id === serverId
276-
? { ...server, ...updates, updatedAt: new Date().toISOString() }
277+
? { ...server, ...safeUpdates, updatedAt: new Date().toISOString() }
277278
: server
278279
)
279280
)

0 commit comments

Comments
 (0)