Files
Cristian PogaceanandCopilot a28c122522 Add an injectable acknowledgement provider model; obsolete event-based APIs
Replaces the event-based acknowledgement contract with injectable, async
providers, as requested in review, and folds in the notification-lifetime work
of #4901.

Public API (Opc.Ua.Client):
- AcknowledgementHandle: identifies the acknowledgement of one message of one
  subscription lifetime; unambiguous when ids are reused or sequence numbers
  restart. Carried by DataValueChange/EventNotification.Acknowledgement (V2)
  and Subscription.TryGetAcknowledgementHandle (classic).
- ISubscriptionAcknowledgementProvider.DecideAsync(ArrayOf<handle>) decides which
  acknowledgements to defer; called concurrently, outside SDK locks, revalidated
  afterwards, fail-closed on exceptions, deferred entries presented again.
- ISubscriptionAcknowledgementObserver.OnCompletedAsync reports every
  acknowledgement exactly once (Acknowledged, NotRetained, OwnerRetired,
  Abandoned), delivered in order from a background loop.
- AcknowledgementMode.AfterConfirmation with ISessionAcknowledgements.Confirm:
  built-in at-least-once delivery (formerly hand-written in applications).
- ISessionAcknowledgements facet on Session and ManagedSession.
- Injection: ManagedSessionOptions, ManagedSessionBuilder
  (AcknowledgeAfterConfirmation, WithAcknowledgementProvider/Observer) and DI
  (AddAcknowledgementProvider<T>, AddAcknowledgementObserver<T>).

Both engines use the providers; the classic engine never blocks its synchronous
publish path on an asynchronous decision. Without a provider or observer no
provider calls, copies or outcome bookkeeping are added.

Obsoleted (still functional, see docs/MigrationGuide.md):
- ISession.PublishSequenceNumbersToAcknowledge (served unchanged when no
  provider is configured);
- classic Subscription.FastDataChangeCallback/FastEventCallback/
  FastKeepAliveCallback and their delegates, ISession.DefaultSubscription.

Docs: docs/Subscriptions.md (Acknowledgement providers), docs/MigrationGuide.md.
Tests: provider/observer/confirmation unit tests, V2 manager tests and
end-to-end tests against the reference server for both engines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-27 03:15:22 +01:00
..