fix(template-engine): carry IsMesReportable onto derived-template placeholder alarms and through descendant reconcile; final-review doc fixes
Claude-Session: https://claude.ai/code/session_01Y5ef34iUUMjmwnMpL9xgmB
This commit is contained in:
@@ -285,6 +285,29 @@ public class CompatibilityTests
|
||||
Assert.Null(deserialized!.AckTime);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BackwardCompat_AlarmStateChanged_MissingIsMesReportable_DefaultsToFalse()
|
||||
{
|
||||
// A frame minted by a node predating the MES-reportable flag omits the property
|
||||
// entirely; it must deserialize to "not reported to MES", not fail. False is the
|
||||
// safe default — an old site's alarms stay out of the MES alarm-status API until
|
||||
// it is upgraded and stamps the flag itself.
|
||||
var json = """
|
||||
{
|
||||
"InstanceUniqueName": "inst-1",
|
||||
"AlarmName": "Tank01.Level.HiHi",
|
||||
"State": 1,
|
||||
"Priority": 900,
|
||||
"Timestamp": "2026-08-01T00:00:00+00:00"
|
||||
}
|
||||
""";
|
||||
|
||||
var deserialized = JsonSerializer.Deserialize<AlarmStateChanged>(json, Options);
|
||||
|
||||
Assert.NotNull(deserialized);
|
||||
Assert.False(deserialized!.IsMesReportable);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RoundTrip_HeartbeatMessage_Succeeds()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user