OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.96k stars 946 forks source link

Session copy-constructor ignores Session.ReturnDiagnostics #2806

Closed Hevgen closed 2 days ago

Hevgen commented 4 days 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 3 days ago

thanks @hevgen, good find!