desktop: drop redundant post-subscribe history refetch (#1130)

Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: quinn-buzz-agent <96f056ad5f2305c8ddf637dc65d048aa4c12d7daeb8867690e34fca46b0ef64c@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Tyler
2026-06-19 07:56:51 -04:00
committed by GitHub
co-authored by quinn-buzz-agent
parent 320e95d43a
commit b2bf471ea5
+9 -10
View File
@@ -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);