Closed RFBomb closed 5 months ago
Session.Browse() is a wrapper for SessionClientBatched.Browse(). It adds the setting
ResultMask = (uint)BrowseResultMask.All
to the browse descriptions before calling SessionClientBatched.Browse()
The call in your question to BrowseAsync seems to be (according to the parameters you have set) a direct call to SessionClientBatched.BrowseAsync or even SessionClient.BrowseAsync, but the BrowseDescription you are providing does not set the ResultMask. In this case the ResultMask defaults to 0 (None). The async equivalent to Browse would be SessionAsync.BrowseAsync, to my understanding. Can you please try again with the BrowseResultMask set?
I won't be able to try this out until next week most likely.
But that begs the question, why is the result mask set in one and not the other? I understand that for the Async call you must manually build the BrowseDescription object, but if that option is omitted I would expect the behavior to be identical, as the other one doesn't explicitly declare it in my usage either. Seems like an oversight.
No, it's not an oversight. The one(s) which populate(s) the browse result mask is/are in the client library, which provides convenience functions for the developer, the other one is/are in the UA core, which usually just implements the service calls as required by the spec.
Understood.
As a temporary measure I had created my own method extension to run the Browse as Async via Task.Run, now I'm aware of the nuance and that it's intentional I'll modify that to build it properly using the mask. Thanks for the response.
Im good with closing this topic unless your team wanted it open as reference.
I'll wait with closing this till our next internal call tomorrow when I will try to discuss this.
We discussed this in the weekly meeting. While we agreed that it is not nice that the generated functions from the UA core are easily mixed up with the API functionality, we will not change anything on short notice.
So I will in fact now close this topic.
Type of issue
Current Behavior
I am testing Browse vs BrowseAsync in my app, and I can not use BrowseAsync, as the result are not equivalent between the two. Specifically, the
ReferenceDescriptionCollection
returned from theBrowse
method has the browse names populates, while the BrowseAsync does not populate those names in the returned collection.Browse![image](https://github.com/OPCFoundation/UA-.NETStandard/assets/20431767/28946223-40a8-46b4-9a9f-41fbf3f201fc)
BrowseAsync![image](https://github.com/OPCFoundation/UA-.NETStandard/assets/20431767/1678986b-6a2f-4f89-acf3-b685837db0a8)
Browse![image](https://github.com/OPCFoundation/UA-.NETStandard/assets/20431767/d8b21124-7276-415e-b3db-5b842eeab6d6)
BrowseAsync![image](https://github.com/OPCFoundation/UA-.NETStandard/assets/20431767/ad99344f-207c-4614-b921-6064bb36ee6e)
Expected Behavior
The names would be populated in both returned collections. I also note that the IsForward property on the result returned from browse is true, while its false on the async object
Steps To Reproduce
My understanding is that these should be functionally identical
Environment
Anything else?
No response