The following code snippet behaves differently after the merge of PR #2768:
string namespaceUri = "KEPServerEX";
string nodeName = "Data Type Examples.16 Bit Device.K Registers.Double3";
String expectedNodeIdString = $"nsu={namespaceUri};s={nodeName}";
ExpandedNodeId expandedNodeId = new ExpandedNodeId(expectedNodeIdString);
string stringifiedExpandedNodId = expandedNodeId.ToString();
Before the merge, the value of expandedNodeId.IdentifierText would read
"nsu=KEPServerEX;Data Type Examples.16 Bit Device.K Registers.Double3".
After the merge it reads
"nsu=http://kepserverex/;s=Data Type Examples.16 Bit Device.K Registers.Double3".
The same effect applies to the result of the ExpandedNodeId.ToString() method. This change is caused by a change to the method
which now checks whether the namespaceUri is not null or empty and (if this is true), applies Utils.EscapeUri(...) to the namespaceUri.
Expected Behavior
I believe that the new behavior may actually be the expected behavior, but it breaks existing applications. Not every server uses strings as namespaceUris which are actually compliant (the example from the code snippet is taken from an existing server).
Since the ExpandedNodeId.ToString() method is very likely used to create application configuration on client side (if the client wants to persist node ids of the server, it must use the ExpandedNodeId), this change (if it is not undone) may invalidate client configurations and force migrations of their configurations
Steps To Reproduce
You can just paste the code snipped as a unit test into the BuildInTests of the Opc.Ua.Core.Tests project and run the test (on a branch first without and then with the PR #2768 merged into it.
Type of issue
Current Behavior
The following code snippet behaves differently after the merge of PR #2768:
Before the merge, the value of
expandedNodeId.IdentifierText
would read "nsu=KEPServerEX;Data Type Examples.16 Bit Device.K Registers.Double3". After the merge it reads "nsu=http://kepserverex/;s=Data Type Examples.16 Bit Device.K Registers.Double3". The same effect applies to the result of theExpandedNodeId.ToString()
method. This change is caused by a change to the methodwhich now checks whether the
namespaceUri
is not null or empty and (if this is true), appliesUtils.EscapeUri(...)
to thenamespaceUri
.Expected Behavior
I believe that the new behavior may actually be the expected behavior, but it breaks existing applications. Not every server uses strings as namespaceUris which are actually compliant (the example from the code snippet is taken from an existing server).
Since the
ExpandedNodeId.ToString()
method is very likely used to create application configuration on client side (if the client wants to persist node ids of the server, it must use the ExpandedNodeId), this change (if it is not undone) may invalidate client configurations and force migrations of their configurationsSteps To Reproduce
You can just paste the code snipped as a unit test into the BuildInTests of the Opc.Ua.Core.Tests project and run the test (on a branch first without and then with the PR #2768 merged into it.
Environment
Anything else?
No response