fix(dcl): route native alarm subscribe/unsubscribe through DataConnectionManagerActor

The NativeAlarmActor sends SubscribeAlarmsRequest to the DCL manager, but the
manager only routed tag/write/browse messages to the per-connection
DataConnectionActor — alarm subscribe/unsubscribe were unhandled and dead-lettered,
so native alarms never subscribed at runtime. Caught by live T28 deployment.
Mirrors the existing HandleRoute forwarding.
This commit is contained in:
Joseph Doherty
2026-05-31 03:25:28 -04:00
parent f4ae44aacc
commit add7210d9e
2 changed files with 44 additions and 0 deletions
@@ -58,6 +58,23 @@ public class DataConnectionManagerActorTests : TestKit
Assert.Contains("Unknown connection", response.ErrorMessage);
}
[Fact]
public void SubscribeAlarmsToUnknownConnection_ReturnsError()
{
// Regression for the live integration gap: the NativeAlarmActor sends
// SubscribeAlarmsRequest to the DCL manager, which must route it to the
// named connection actor (or reply with an error) — not dead-letter it.
var manager = Sys.ActorOf(Props.Create(() =>
new DataConnectionManagerActor(_mockFactory, _options, _mockHealthCollector)));
manager.Tell(new SubscribeAlarmsRequest(
"corr1", "inst1", "nonexistent", "ns=2;s=Tank01", null, DateTimeOffset.UtcNow));
var response = ExpectMsg<SubscribeAlarmsResponse>();
Assert.False(response.Success);
Assert.Contains("Unknown connection", response.ErrorMessage);
}
[Fact]
public async Task DCL002_ConnectionActorCrash_PreservesSubscriptionState()
{