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:
Joseph Doherty
2026-05-28 11:41:46 -04:00
parent 64e4726fff
commit dcd2509548
4 changed files with 35 additions and 33 deletions
@@ -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.