mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
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:
co-authored by
quinn-buzz-agent
parent
320e95d43a
commit
b2bf471ea5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user