From 2932a7a35dc1af306177b7a53324c0cac978d2c5 Mon Sep 17 00:00:00 2001 From: Shawn Date: Tue, 19 May 2026 20:31:36 +0800 Subject: [PATCH] fix(app): invalidate provider queries after config update to show custom providers immediately (#28313) --- packages/app/src/context/global-sync.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/app/src/context/global-sync.tsx b/packages/app/src/context/global-sync.tsx index 594f94fb62..96c4526da6 100644 --- a/packages/app/src/context/global-sync.tsx +++ b/packages/app/src/context/global-sync.tsx @@ -422,7 +422,13 @@ function createGlobalSync() { const updateConfigMutation = useMutation(() => ({ mutationFn: (config: Config) => globalSDK.client.global.config.update({ config }), - onSuccess: () => bootstrap.refetch(), + onSuccess: () => { + bootstrap.refetch() + // Invalidate all provider queries so newly configured custom providers + // appear immediately in the available provider list across all directories. + queryClient.invalidateQueries({ queryKey: [null, "providers"] }) + queryClient.invalidateQueries({ predicate: (query) => query.queryKey[1] === "providers" }) + }, })) return {