fix(central-ui): resolve CentralUI-006 — push-based deployment status via IDeploymentStatusNotifier, remove 10s polling timer
This commit is contained in:
@@ -56,4 +56,25 @@ public class ServiceCollectionExtensionsTests
|
||||
{
|
||||
Assert.Equal("ScadaLink:DeploymentManager", ServiceCollectionExtensions.OptionsSection);
|
||||
}
|
||||
|
||||
// CentralUI-006: the deployment-status notifier must be a singleton so the
|
||||
// scoped DeploymentService and the Central UI's scoped Blazor page share
|
||||
// one instance — without that, a push notification raised by the service
|
||||
// would never reach the page's subscription.
|
||||
[Fact]
|
||||
public void AddDeploymentManager_RegistersDeploymentStatusNotifier_AsSingleton()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
services.AddLogging();
|
||||
services.AddDeploymentManager();
|
||||
|
||||
using var provider = services.BuildServiceProvider();
|
||||
|
||||
var fromRoot = provider.GetRequiredService<IDeploymentStatusNotifier>();
|
||||
using var scope = provider.CreateScope();
|
||||
var fromScope = scope.ServiceProvider.GetRequiredService<IDeploymentStatusNotifier>();
|
||||
|
||||
Assert.IsType<DeploymentStatusNotifier>(fromRoot);
|
||||
Assert.Same(fromRoot, fromScope);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user