diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Phase7Plan.cs b/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Phase7Plan.cs index cae06653..84ded60b 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Phase7Plan.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/Phase7Plan.cs @@ -112,10 +112,11 @@ public static class Phase7Planner t => t.TagId, (a, b) => new Phase7Plan.EquipmentTagDelta(a, b)); - // VirtualTags diff by VirtualTagId, mirroring the EquipmentTags pass. Element equality on - // EquipmentVirtualTagPlan compares its scalar fields (Expression/DataType/Name/FolderPath/…) - // by value; DependencyRefs (an IReadOnlyList) compares by reference, so a fresh list - // instance is conservatively treated as changed — fine for a rebuild trigger. + // VirtualTags diff by VirtualTagId, mirroring the EquipmentTags pass. EquipmentVirtualTagPlan + // overrides record equality to compare ALL fields by value — scalars (Expression/DataType/ + // Name/FolderPath) plus DependencyRefs element-wise (SequenceEqual). So a no-op redeploy (fresh + // list instances, identical contents) correctly diffs to empty; only a real content change is + // flagged as changed. var (addedVTags, removedVTags, changedVTags) = DiffById( previous.EquipmentVirtualTags, next.EquipmentVirtualTags, t => t.VirtualTagId,