From 76806cb1f654650a412b7f0368f495062a9ee224 Mon Sep 17 00:00:00 2001 From: Wes Date: Mon, 6 Jul 2026 16:05:44 -0600 Subject: [PATCH] fix(desktop): stop edit-channel dialog hanging on "Saving..." (#1557) Signed-off-by: Wes Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> --- desktop/src/features/channels/hooks.ts | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/desktop/src/features/channels/hooks.ts b/desktop/src/features/channels/hooks.ts index 91e6aebd62..2c41ff1e74 100644 --- a/desktop/src/features/channels/hooks.ts +++ b/desktop/src/features/channels/hooks.ts @@ -268,8 +268,20 @@ export function useUpdateChannelMutation(channelId: string | null) { ), ); }, - onSettled: async () => { - await invalidateChannelState(queryClient, channelId); + onSettled: () => { + // refetchType "none": onSuccess already cached the relay-returned detail; + // awaiting the full channel-list refetch kept the edit dialog stuck on + // "Saving..." (same failure #1360 fixed for create). + void queryClient.invalidateQueries({ + queryKey: channelsQueryKey, + refetchType: "none", + }); + if (channelId) { + void queryClient.invalidateQueries({ + queryKey: channelDetailQueryKey(channelId), + refetchType: "none", + }); + } }, }); } @@ -285,8 +297,9 @@ export function useSetChannelTopicMutation(channelId: string | null) { return setChannelTopic({ ...input, channelId }); }, - onSettled: async () => { - await invalidateChannelState(queryClient, channelId); + onSettled: () => { + // fire-and-forget: awaiting the channels-list refetch blocks the dialog + void invalidateChannelState(queryClient, channelId); }, }); } @@ -302,8 +315,9 @@ export function useSetChannelPurposeMutation(channelId: string | null) { return setChannelPurpose({ ...input, channelId }); }, - onSettled: async () => { - await invalidateChannelState(queryClient, channelId); + onSettled: () => { + // fire-and-forget: awaiting the channels-list refetch blocks the dialog + void invalidateChannelState(queryClient, channelId); }, }); }