fix(dashboard): guard stale-session batches inside the renderer dispatch; register IDashboardSessionEventSubscriber

This commit is contained in:
Joseph Doherty
2026-08-15 20:26:42 -04:00
parent 10406a3541
commit 38dd7678f2
3 changed files with 91 additions and 21 deletions
@@ -45,4 +45,23 @@ public sealed class DashboardHubsRegistrationTests
.GetRequiredService<DashboardHubConnectionFactory>();
Assert.NotNull(factory);
}
/// <summary>
/// The publish and in-process subscribe faces of the event mirror must resolve to
/// one instance: two would leave the session-details page reading a mirror the
/// session pipeline never publishes to, and the viewer gate would never open.
/// </summary>
/// <returns>A task that represents the asynchronous operation.</returns>
[Fact]
public async Task Build_WhenDashboardEnabled_ResolvesBothEventMirrorInterfacesToOneInstance()
{
await using WebApplication app = GatewayApplication.Build([]);
IDashboardEventBroadcaster broadcaster = app.Services.GetRequiredService<IDashboardEventBroadcaster>();
IDashboardSessionEventSubscriber subscriber = app.Services
.GetRequiredService<IDashboardSessionEventSubscriber>();
Assert.Same(broadcaster, subscriber);
Assert.Same(app.Services.GetRequiredService<DashboardEventBroadcaster>(), broadcaster);
}
}