feat(msg-bus): resubscribe topics on reconnect

This commit is contained in:
Edouard Vanbelle
2026-09-11 03:12:48 +02:00
parent 75a123ae6c
commit 41d25d3a3e
4 changed files with 122 additions and 0 deletions
@@ -484,6 +484,21 @@
);
busLog.warn('folder access revoked', { topic: params.topic, reason: params.reason });
void goto(resolve('/files'));
},
onReconnect: () => {
// WS reconnected after a prior disconnect — any bus events
// published during the outage window were dropped by the
// in-memory bus (no replay). Force a refetch so the listing
// catches up with the server-authoritative state. Goes
// through the same `scheduleLiveReload` coalescer as event-
// driven refreshes so a burst of reconnects (rare, but the
// circuit breaker can produce one) collapses to a single
// fetch. Passing an actor of `null`-equivalent — use an
// empty string so the echo-skip's `actor === user.id`
// check never matches. See
// `project_message_bus_reconnect_gap` memory.
busLog.warn('reconnected — refetching folder');
scheduleLiveReload('');
}
});