OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.9k stars 926 forks source link

[PubSub] BuiltInType.Null array handling inconsistency #2522

Open etoensfeldt opened 4 months ago

etoensfeldt commented 4 months ago

Type of issue

Current Behavior

Currently ValueRank for BuiltInType.Null fields gets ignored when decoding mqtt messages: https://github.com/OPCFoundation/UA-.NETStandard/blob/2b9d8f9de56bc062b21f988e3f4a967a032321ff/Libraries/Opc.Ua.PubSub/Encoding/JsonDataSetMessage.cs#L533

However sending a data for a BuiltInType.Null field will keep the data and therefore ValueRank intact, instead of sending just null over MQTT. (I haven't checked if this is also the case for UADP)

This strikes me a bit inconsistant, is this intentional?

Expected Behavior

I'd expect when sending an array with two null elements to also be able to receive an (object-)array with two null elements. The sending side currently works, however the received UaNetworkMessage only contains a null scalar.

The usefulness of this may arguably be low, but it would offer more consistent behavior and not lose the sent information about array dimensions.

Steps To Reproduce

No response

Environment

- Nuget Version: 1.5.373.121
- Component: Opc.Ua.PubSub
- Server: Mqtt (HiveMQ)

Anything else?

No response