fix(dashboard): guard stale-session batches inside the renderer dispatch; register IDashboardSessionEventSubscriber
This commit is contained in:
@@ -51,7 +51,17 @@ public static class DashboardServiceCollectionExtensions
|
||||
// Singleton: EventsHub instances are transient (one per hub invocation), so the
|
||||
// subscriber bookkeeping they share with the broadcaster must outlive them.
|
||||
services.AddSingleton<Hubs.EventsHubViewerRegistry>();
|
||||
services.AddSingleton<Hubs.IDashboardEventBroadcaster, Hubs.DashboardEventBroadcaster>();
|
||||
|
||||
// One instance behind two interfaces, registered concretely and forwarded: the
|
||||
// publish side (IDashboardEventBroadcaster, driven by the session pipeline) and
|
||||
// the in-process subscribe side (IDashboardSessionEventSubscriber, used by the
|
||||
// session-details page) share subscriber bookkeeping, so resolving them to two
|
||||
// instances would leave the page subscribed to a mirror nobody publishes to.
|
||||
services.AddSingleton<Hubs.DashboardEventBroadcaster>();
|
||||
services.AddSingleton<Hubs.IDashboardEventBroadcaster>(
|
||||
static provider => provider.GetRequiredService<Hubs.DashboardEventBroadcaster>());
|
||||
services.AddSingleton<Hubs.IDashboardSessionEventSubscriber>(
|
||||
static provider => provider.GetRequiredService<Hubs.DashboardEventBroadcaster>());
|
||||
services.AddSingleton<Hubs.DashboardSnapshotHubConnectionCounter>();
|
||||
services.AddHostedService<Hubs.DashboardSnapshotPublisher>();
|
||||
services.AddHostedService<Hubs.AlarmsHubPublisher>();
|
||||
|
||||
Reference in New Issue
Block a user