From cf57bcbea4af355774d499e109238a5d527ae39e Mon Sep 17 00:00:00 2001 From: Wes Date: Mon, 29 Jun 2026 13:55:31 -0600 Subject: [PATCH] perf(desktop): don't block channel create on channel-list refetch (#1360) Signed-off-by: Wes Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> --- desktop/src/features/channels/hooks.ts | 10 ++++++++-- .../src/features/channels/ui/ChannelPane.helpers.ts | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/desktop/src/features/channels/hooks.ts b/desktop/src/features/channels/hooks.ts index b6d4d7299..49ba1ea5e 100644 --- a/desktop/src/features/channels/hooks.ts +++ b/desktop/src/features/channels/hooks.ts @@ -125,8 +125,14 @@ export function useCreateChannelMutation() { ]), ); }, - onSettled: async () => { - await queryClient.invalidateQueries({ queryKey: channelsQueryKey }); + onSettled: () => { + // refetchType "none": onSuccess already cached the relay-returned channel; + // an immediate getChannels() refetch blocked the dialog and could clobber + // it with a read-after-write-lagged snapshot. Live updates reconcile later. + void queryClient.invalidateQueries({ + queryKey: channelsQueryKey, + refetchType: "none", + }); }, }); } diff --git a/desktop/src/features/channels/ui/ChannelPane.helpers.ts b/desktop/src/features/channels/ui/ChannelPane.helpers.ts index 8aef5f523..a30ee2411 100644 --- a/desktop/src/features/channels/ui/ChannelPane.helpers.ts +++ b/desktop/src/features/channels/ui/ChannelPane.helpers.ts @@ -23,7 +23,7 @@ export function getChannelIntroDescription(channel: Channel): string | null { return ( channel.topic?.trim() || channel.purpose?.trim() || - channel.description.trim() || + channel.description?.trim() || null ); }