Skip to content

[Client] Fix closing of shared Transport Channel in Recreate Scenario / Add missing event Handler to Session Constructor / Call RenewUserIdentity on Session.ReCreate - #3055

Merged
mrsuciu merged 9 commits into
OPCFoundation:masterfrom
romanett:fixSession
May 23, 2025
Merged

Conversation

@romanett

@romanett romanett commented Apr 15, 2025

Copy link
Copy Markdown
Contributor

Proposed changes

Some Session Methods have an overload to share an (expensive) channel between multiple session. However in some reconnect/recreate /fail to Open Session Scenario the shared transport channel is closed by the Open Mehtod of the Session. Therefore this PR Extends the Session.Open Method to select if the used Transport Channel shall be closed.

Also the Session Constructor taking a template missed to copy the m_RenewUserIdentity event handler to the new session

The Session.ReCreate(Async) Methods now also fire the RenewUserIdentity Event before Session.Open is called to refresh an expired user identity token.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

…he used channel is closed when the Session.Open fails

Add Missing Event Handler m_RenewUserIdentity om Session constructor taking a template
@codecov

codecov Bot commented Apr 15, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 54.54545% with 15 lines in your changes missing coverage. Please review.

Project coverage is 57.25%. Comparing base (95d162e) to head (df80db2).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
...ibraries/Opc.Ua.Client/Session/TraceableSession.cs 0.00% 8 Missing ⚠️
Libraries/Opc.Ua.Client/Session/SessionAsync.cs 60.00% 4 Missing ⚠️
Libraries/Opc.Ua.Client/Session/Session.cs 80.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3055      +/-   ##
==========================================
+ Coverage   57.00%   57.25%   +0.25%     
==========================================
  Files         357      357              
  Lines       68916    68983      +67     
  Branches    14154    14158       +4     
==========================================
+ Hits        39285    39496     +211     
+ Misses      25385    25244     -141     
+ Partials     4246     4243       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@romanett romanett changed the title [Cleint] Extend Session.Open Method with new overload allowing to specify transportChannelClose [Client] Extend Session.Open Method with new overload allowing to specify transportChannelClose Apr 15, 2025
@romanett romanett changed the title [Client] Extend Session.Open Method with new overload allowing to specify transportChannelClose [Client] Fix closing of shared Transport Channel in Recreate Scenario / Add missing event Handler to Session Constructor May 2, 2025
@romanett
romanett marked this pull request as ready for review May 2, 2025 11:29
@romanett romanett added this to the 1.5.376 Maintenance Update milestone May 6, 2025
@romanett romanett self-assigned this May 6, 2025
@romanett romanett changed the title [Client] Fix closing of shared Transport Channel in Recreate Scenario / Add missing event Handler to Session Constructor [Client] Fix closing of shared Transport Channel in Recreate Scenario / Add missing event Handler to Session Constructor / Call RenewUserIdentity on Session.ReCreate May 6, 2025
@romanett
romanett requested review from marcschier and mrsuciu May 6, 2025 05:17
Comment thread Libraries/Opc.Ua.Client/Session/Session.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants