From 23e4e9b4d1854ce8f8ade8dd24249a5bdd232d2a Mon Sep 17 00:00:00 2001 From: c0mrade Date: Tue, 26 May 2026 13:58:33 +0300 Subject: [PATCH] fix(profile,connected-accounts): drop dead ['user'] invalidate calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit queryClient.invalidateQueries({ queryKey: ['user'] }) appears twice in the codebase but no useQuery with that key is registered anywhere — the auth user is a zustand store, not a React Query cache entry. The invalidations were silent no-ops that suggested wiring that did not exist. The actual refresh path (await getMe + setUser) was already in place right above each invalidate, so the cleanup is purely cosmetic + documentation: replace with a comment explaining where the user state actually lives, so the next reader doesn't try to invalidate it again. --- src/pages/ConnectedAccounts.tsx | 3 ++- src/pages/Profile.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/ConnectedAccounts.tsx b/src/pages/ConnectedAccounts.tsx index 78467d3..94d84a1 100644 --- a/src/pages/ConnectedAccounts.tsx +++ b/src/pages/ConnectedAccounts.tsx @@ -404,7 +404,8 @@ export default function ConnectedAccounts() { const updatedUser = await authApi.getMe(); setUser(updatedUser); queryClient.invalidateQueries({ queryKey: ['linked-providers'] }); - queryClient.invalidateQueries({ queryKey: ['user'] }); + // Note: auth user lives in the zustand store, not in React Query — + // the explicit setUser above IS the refresh. No ['user'] query exists. }, onError: (err: { response?: { data?: { detail?: string } } }) => { const detail = err.response?.data?.detail; diff --git a/src/pages/Profile.tsx b/src/pages/Profile.tsx index 1318718..58a2725 100644 --- a/src/pages/Profile.tsx +++ b/src/pages/Profile.tsx @@ -193,7 +193,8 @@ export default function Profile() { setChangeEmailStep('success'); const updatedUser = await authApi.getMe(); setUser(updatedUser); - queryClient.invalidateQueries({ queryKey: ['user'] }); + // Note: auth user lives in the zustand store, not in React Query — + // the explicit setUser above IS the refresh. No ['user'] query exists. }, onError: (err: { response?: { data?: { detail?: string } } }) => { const detail = err.response?.data?.detail;