4 Commits
Author SHA1 Message Date
Suciu Mircea Adrian f69ff78702 Use request.SessionId instead of request.Session.Id in the ReportAuditCancelEvent call from CancelRequests (#3850)
Use request.SessionId instead of request.Session.Id in the
ReportAuditCancelEvent call from CancelRequests to avoid accessing
Session in case ActivateSession

# Description

Cancel service is returning BadUnexpectedError because audit reporting
crashes on request.Session.Id in case the ActivateSession service call
is in-flight and its cancelation is requested becasue Session is null.

- Fixes #3848 

## Checklist

_Put an `x` in the boxes that apply. You can complete these step by step
after opening the PR._

- [ ] I have signed the
[CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf)
and read the
[CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md)
doc.
- [ ] I have added tests that prove my fix is effective or that my
feature works and increased code coverage.
- [ ] I have added all necessary documentation.
- [ ] I have verified that my changes do not introduce (new) build or
analyzer warnings.
- [ ] I ran **all** tests locally using the **UA.slnx** solution against
at least .net **framework** and .net **10**, and all passed.
- [ ] I fixed **all** failing and flaky tests in the CI pipelines and
**all** CodeQL warnings.
- [ ] I have addressed **all** PR feedback received.
2026-06-05 21:27:15 +03:00
Marc Schier fd41681f4b Add support to publish OPC UA applications as Native AOT (#3633)
* make most ptojects aot compatible
* Remove newtonsoft
* Migrate all projects from Mono.Options to System.CommandLine 2.0.5
* Fix array clone
* Replace serializers for storage using new attribute driven  type geberator
* Add new AOT integration tests covering all functional areas
* Documentation updates
2026-04-13 20:52:29 +02:00
f859245ebe Add unit tests for Server Subscription and Session handling (#3639)
* Add comprehensive unit tests for Server Subscription and Session handling

- SubscriptionLifecycleTests.cs: 46 tests covering subscription lifecycle
  (constructor, modify, publish mode, queue overflow, session closed,
  publish timeout, republish, durable subscriptions, triggering, etc.)
- SessionExtendedTests.cs: 29 tests covering session operations
  (expiry, channel validation, locale updates, continuation points,
  diagnostics, ValidateRequest, etc.)

All 578 tests pass (503 existing + 75 new).

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OPCFoundation/UA-.NETStandard/sessions/d28cf5ce-a461-4e95-b23f-689ec5f5113b

* Remove all #region/#endregion directives from new test files

Agent-Logs-Url: https://github.com/OPCFoundation/UA-.NETStandard/sessions/a845e70e-0caa-4ed9-b694-c696b38b7e73

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

* Fix net472 build: replace ValueTask.CompletedTask with default(ValueTask)

Agent-Logs-Url: https://github.com/OPCFoundation/UA-.NETStandard/sessions/36d75700-6e4a-4183-909a-95215e97932d

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

* merge

* cleanup

* fix

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
Co-authored-by: Roman Ettlinger <romanett98@gmail.com>
2026-03-31 10:13:52 +02:00
romanett 23f10d89ee [Server] Introduce RequestLifetime for request handling and cancellation (#3643)
Use RequestLifetime throughout the server stack for unified request lifetime and cancellation management. Update all service method signatures, OperationContext, and request processing logic to use RequestLifetime, enabling precise tracking of cancellation reasons with UA StatusCodes. Remove obsolete synchronous request handling and legacy delegates. Update code generation, tests, and interfaces to support the new model. This change improves cancellation, timeout, and abort handling, and prepares the server for advanced request management features.
2026-03-30 13:17:19 +02:00