From 01d46223bdf56d87c1547df4f5c8ecc8456b980b Mon Sep 17 00:00:00 2001 From: Wes Date: Tue, 28 Apr 2026 18:57:30 -0700 Subject: [PATCH] fix(desktop): improve sidebar reactivity for new DMs and channel updates Wire live mention WebSocket events to also invalidate the channels query, so the sidebar refreshes immediately when activity is detected. Reduce channels polling interval from 60s to 15s as a safety net for genuinely new channels (e.g. bot-created DMs) that the WebSocket subscription doesn't know about yet. Co-Authored-By: Claude Opus 4.6 --- desktop/src/app/AppShell.tsx | 1 + desktop/src/features/channels/hooks.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/desktop/src/app/AppShell.tsx b/desktop/src/app/AppShell.tsx index 753b6b8c2..eabe1d49e 100644 --- a/desktop/src/app/AppShell.tsx +++ b/desktop/src/app/AppShell.tsx @@ -155,6 +155,7 @@ export function AppShell() { ); const refetchHomeFeedOnLiveMention = React.useEffectEvent(() => { void homeFeedQuery.refetch(); + void queryClient.invalidateQueries({ queryKey: channelsQueryKey }); }); const handleDmNotification = React.useEffectEvent( diff --git a/desktop/src/features/channels/hooks.ts b/desktop/src/features/channels/hooks.ts index 20d874203..d0de14fd0 100644 --- a/desktop/src/features/channels/hooks.ts +++ b/desktop/src/features/channels/hooks.ts @@ -109,8 +109,8 @@ export function useChannelsQuery() { return useQuery({ queryKey: channelsQueryKey, queryFn: async () => sortChannels(await getChannels()), - staleTime: 60_000, - refetchInterval: 60_000, + staleTime: 15_000, + refetchInterval: 15_000, refetchIntervalInBackground: false, }); }