From b2bf471ea581e768647f3f3ad055bffbf7803f08 Mon Sep 17 00:00:00 2001 From: Tyler <109685178+tlongwell-block@users.noreply.github.com> Date: Fri, 19 Jun 2026 07:56:51 -0400 Subject: [PATCH] desktop: drop redundant post-subscribe history refetch (#1130) Signed-off-by: Tyler Longwell Co-authored-by: quinn-buzz-agent <96f056ad5f2305c8ddf637dc65d048aa4c12d7daeb8867690e34fca46b0ef64c@sprout-oss.stage.blox.sqprod.co> --- desktop/src/features/messages/hooks.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/desktop/src/features/messages/hooks.ts b/desktop/src/features/messages/hooks.ts index 952416c21..57db8b13c 100644 --- a/desktop/src/features/messages/hooks.ts +++ b/desktop/src/features/messages/hooks.ts @@ -277,16 +277,15 @@ export function useChannelSubscription(channel: Channel | null) { } cleanup = dispose; - - void syncLatestHistory().catch((error) => { - if (!isDisposed) { - console.error( - "Failed to refresh channel history after subscribing", - channelId, - error, - ); - } - }); + // No post-subscribe history refetch: useChannelMessagesQuery already + // loaded the latest CHANNEL_HISTORY_LIMIT (200) events, and the live + // subscription itself backfills up to 50 most-recent events via its + // initial REQ (buildChannelFilter(id, 50)). Both write into the same + // channelMessagesKey cache, so any window between the two REQs is + // covered by the live sub's overlap unless >50 messages land in + // <1s — vanishingly rare in practice. The reconnect listener above + // still bridges gaps from connection drops, where the gap *is* + // unbounded. }) .catch((error) => { console.error("Failed to subscribe to channel", channelId, error);