Skip to content

Commit

Permalink
#2777 Fix for - MonitoredItem2.OnReportEvent Ignores Session in ISyst…
Browse files Browse the repository at this point in the history
…emContext During Notification Process (#2779)

Check the Session included in the ISystemContext instance, if any, and compare it with those belonging to the monitored items.
If the ISystemContext instance contains a Session, the event will be appended only to the monitored items belonging to the same Session.
If the ISystemContext instance does not contain a Session, the event will be appended to all monitored items, regardless of their sessions.
  • Loading branch information
Filippo-Oliva-ABB authored Oct 10, 2024
1 parent 23b8502 commit 711160e
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Libraries/Opc.Ua.Server/Diagnostics/MonitoredNode.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Copyright (c) 2005-2020 The OPC Foundation, Inc. All rights reserved.
* Copyright (c) 2005-2024 The OPC Foundation, Inc. All rights reserved.
*
* OPC Foundation MIT License 1.00
*
Expand Down Expand Up @@ -253,7 +253,22 @@ public void OnReportEvent(ISystemContext context, NodeState node, IFilterTarget
lock (NodeManager.Lock)
{
// enqueue event
monitoredItem?.QueueEvent(e);
if (context?.SessionId != null && monitoredItem?.Session?.Id?.Identifier != null)
{
if (monitoredItem.Session.Id.Identifier.Equals(context.SessionId.Identifier))
{
monitoredItem?.QueueEvent(e);
}
else
{
continue;
}
}
else
{
monitoredItem?.QueueEvent(e);
}

}
}
}
Expand Down

0 comments on commit 711160e

Please sign in to comment.