OPCFoundation / UA-.NETStandard

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

Session copy-constructor ignores Session.ReturnDiagnostics #2806

Closed Hevgen closed 4 weeks ago

Hevgen commented 1 month ago

Type of issue

Current Behavior

Class Opc.Ua.Client.Session has a constructor: public Session(ITransportChannel channel, Session template, bool copyEventHandlers) This copy-constructor doesn't copy value of property ReturnDiagnostics of template into new instance. As result Session.CloneSession() and Session.Recreate() also lose ReturnDiagnostics from the source session instance.

I suppose that next line should be added into the Session constructor: ReturnDiagnostics = template.ReturnDiagnostics;

Expected Behavior

Value of ReturnDiagnostics from source instance should be copied into new instance of Session during call of copy-constructor.

Steps To Reproduce

No response

Environment

- Version: 1.5.374.126
- Component: Opc.Ua.Client

Anything else?

No response

mregen commented 4 weeks ago

thanks @hevgen, good find!