OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.97k stars 950 forks source link

MonitoredItem2.OnReportEvent Ignores Session in ISystemContext During Notification Process #2777

Closed Filippo-Oliva-ABB closed 1 month ago

Filippo-Oliva-ABB commented 1 month ago

Type of issue

Current Behavior

The MonitoredNode2.OnReportEvent method does not take into account the Session included in the passed ISystemContext during the notification process. Currently, when a Session is included, the notification occurs on each connected session without checking the specific session passed through the ISystemContext.

Expected Behavior

The MonitoredNode2.OnReportEvent method should only notify the Session specified in the ISystemContext, if any, otherwise all the connected session.

Steps To Reproduce

  1. Single OPC UA server providing a single “NodeManager” that Creates and exposes the whole address space.
  2. Two clients (Client1 and Client2) connected to the server, both subscribed to events of the same node
  3. Override the ConditionRefresh method of the NodeManager trying to notify some event to the subscribed node by calling the ReportEvent method exposed by that node passing as the first parameter a copy of the SystemContext that includes the OperationContext got by the ConditionRefresh method.

Environment

- OS: Windows 10
- Environment: Visual Studio 2019 16.11.33
- Runtime: .NET Framework 4.8
- Nuget Version: 1.5.364.36
- Component: Opc.Ua.Server
- Server: Quickstarts.ConsoleReferenceServer
- Client: UA Expert