Skip to content

reuse usertokenpolicy used in connect for Reconnect / "ReactivateSession"#3581

Open
KircMax wants to merge 8 commits intoOPCFoundation:masterfrom
KircMax:KircMax/ReuseUserTokenPolicy
Open

reuse usertokenpolicy used in connect for Reconnect / "ReactivateSession"#3581
KircMax wants to merge 8 commits intoOPCFoundation:masterfrom
KircMax:KircMax/ReuseUserTokenPolicy

Conversation

@KircMax
Copy link
Contributor

@KircMax KircMax commented Feb 24, 2026

Proposed changes

Describe the changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Related Issues

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • 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

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • 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

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@KircMax
Copy link
Contributor Author

KircMax commented Feb 24, 2026

image

@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.10%. Comparing base (d25caff) to head (7561d10).
⚠️ Report is 133 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #3581       +/-   ##
===========================================
+ Coverage   51.86%   66.10%   +14.23%     
===========================================
  Files         370      459       +89     
  Lines       78618    97717    +19099     
  Branches    13650    16377     +2727     
===========================================
+ Hits        40779    64597    +23818     
+ Misses      33705    28044     -5661     
- Partials     4134     5076      +942     

☔ 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.

.GetEndpointAsync(ServerUrl, securityPolicy, Endpoints)
.ConfigureAwait(false);
endpoint.Description.SecurityMode = MessageSecurityMode.Sign;
Assert.NotNull(endpoint);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some messages here and to the next Assert.NotNull, this will be hard to debug when something in the Clientfixture changes so e.g. the endpoint is now not available any more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed to Assert.Ignore which is also done later when the identityPolicy is null so then it'll be ignored in the future (?) or do you prefer a message rather?

Copy link
Contributor

@romanett romanett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a reasonable change.
Only issue I see is when the Policy is removed from the Server, but this is a general case that is not handled in reconnect afaik and we have an Issue oipen for that.

@KircMax
Copy link
Contributor Author

KircMax commented Mar 5, 2026

is there anything more I should do?

@romanett
Copy link
Contributor

romanett commented Mar 5, 2026

@KircMax CI isnt passing yet before we cant merge

@KircMax
Copy link
Contributor Author

KircMax commented Mar 5, 2026

@romanett can you please give me a mention once the issue with the failing tests is fixed on master?
Then I will rebase the branches accordingly then the PRs should be able to run.

@romanett
Copy link
Contributor

romanett commented Mar 6, 2026

@KircMax can you set in Server.AuditEvents.ReportAuditActivateSessionEvent in line 1072
Utils.Clone(session?.IdentityToken?.Token),
The second "?" was missed when fixing the Audit Event, sorry

@KircMax
Copy link
Contributor Author

KircMax commented Mar 6, 2026

@romanett I guess that didn't yet do the trick

@KircMax
Copy link
Contributor Author

KircMax commented Mar 6, 2026

but since the other 2 PRs now had successful runs of the testcases I guess it might rather actually be related to these changes...

@romanett
Copy link
Contributor

romanett commented Mar 6, 2026

Server did not return an EndpointDescription that matched the one used to create the secure channel.

Seems to be the cause, you will investigate the Test cases right?

@KircMax
Copy link
Contributor Author

KircMax commented Mar 9, 2026

@romanett do you think this failure in the last
run is related to these changes?
I also do not fully understand the other failure

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.

The PolicyId that has been used to activate the session is not used for reconnect ("reactivatesession")

3 participants