#2656 Fix for - Session is not provided by ClearChangeMasks when a change is notified (#2772)

It fixes #2656 by including in the SystemContext (taken as an argument to the OnMonitoredNodeChanged method) the Server session related to the current MonitoredItem that is going to be passed to the QueueValue.
This commit is contained in:
Filippo-Oliva-ABB
2024-10-10 19:56:28 +02:00
committed by GitHub
parent 44dc73460a
commit 9c7b321ecb
@@ -294,13 +294,31 @@ namespace Opc.Ua.Server
if (monitoredItem.AttributeId == Attributes.Value && (changes & NodeStateChangeMasks.Value) != 0)
{
QueueValue(context, node, monitoredItem);
ServerSystemContext serverSystemContext;
if ((serverSystemContext = (context as ServerSystemContext)) != null)
{
ServerSystemContext context2 = serverSystemContext.Copy(new OperationContext(monitoredItem.Session, monitoredItem.DiagnosticsMasks));
QueueValue(context2, node, monitoredItem);
}
else
{
QueueValue(context, node, monitoredItem);
}
continue;
}
if (monitoredItem.AttributeId != Attributes.Value && (changes & NodeStateChangeMasks.NonValue) != 0)
{
QueueValue(context, node, monitoredItem);
ServerSystemContext serverSystemContext2;
if ((serverSystemContext2 = (context as ServerSystemContext)) != null)
{
ServerSystemContext context3 = serverSystemContext2.Copy(new OperationContext(monitoredItem.Session, monitoredItem.DiagnosticsMasks));
QueueValue(context3, node, monitoredItem);
}
else
{
QueueValue(context, node, monitoredItem);
}
continue;
}
}