refactor(driver-pages): address post-review follow-ups
- DriverInstanceSpec carries ClusterId from the deployment artifact; DriverHostActor threads the real cluster identity into DriverInstanceActor instead of the local NodeId. Old pre-PR artifacts without a ClusterId field fall back to the NodeId so in-flight deployments keep working. - DriverHostActor.ChildEntry holds the full DriverInstanceSpec (was only carrying DriverType + LastConfigJson). Restart respawns preserve RowId, Name, Enabled, ClusterId — no placeholder values. - Drop the unnecessary _faultLock on DriverInstanceActor — every read/write site runs inside an Akka message handler which is single-threaded per actor instance. - DriverStatusPanel.DisposeAsync awaits Timer.DisposeAsync so an in-flight 5s tick can't invoke StateHasChanged on a component whose hub has already been torn down.
This commit is contained in:
+5
-3
@@ -270,10 +270,12 @@
|
||||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
_timer?.Dispose();
|
||||
// Drain the timer first so an in-flight callback can't invoke StateHasChanged on
|
||||
// a component that's already releasing its hub. System.Threading.Timer implements
|
||||
// IAsyncDisposable in .NET 6+; the async dispose awaits any in-flight callback.
|
||||
if (_timer is not null) await _timer.DisposeAsync();
|
||||
_opResultClearTimer?.Dispose();
|
||||
if (_hub is not null)
|
||||
await _hub.DisposeAsync();
|
||||
if (_hub is not null) await _hub.DisposeAsync();
|
||||
}
|
||||
|
||||
// Map DriverState string → chip CSS class using the 4 defined theme variants.
|
||||
|
||||
Reference in New Issue
Block a user