fix(communication): drop IsConfiguredPlaceholder rows in StreamRelayActor before gRPC pack

Placeholder AlarmStateChanged rows are a DebugView snapshot-only concept emitted
by InstanceActor.BuildAlarmStatesSnapshot; they are never a real alarm transition.
Their timestamp may be DateTimeOffset.MinValue (the Protobuf Timestamp lower boundary),
which can throw when packed via Timestamp.FromDateTimeOffset.

Added early-return guard at the top of HandleAlarmStateChanged before any timestamp
pack or channel write. Updated the existing NativeBindingLinkage round-trip test to
use a real (non-placeholder) native alarm; added DropsAlarmStateChanged_WhenIsConfiguredPlaceholder
to assert placeholders are silently dropped (15/15 pass).
This commit is contained in:
Joseph Doherty
2026-06-17 15:44:28 -04:00
parent 7f59ae12cb
commit e7660134f2
2 changed files with 48 additions and 6 deletions
@@ -56,6 +56,15 @@ public class StreamRelayActor : ReceiveActor
private void HandleAlarmStateChanged(AlarmStateChanged msg)
{
// Placeholder rows (IsConfiguredPlaceholder) are a Debug View snapshot-only
// concept emitted by InstanceActor.BuildAlarmStatesSnapshot — they are never a
// real alarm transition and must not be relayed to the live gRPC stream (their
// timestamp may be DateTimeOffset.MinValue, the Protobuf Timestamp boundary).
if (msg.IsConfiguredPlaceholder)
{
return;
}
var protoEvent = new SiteStreamEvent
{
CorrelationId = _correlationId,