mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-24 02:58:36 +08:00
b105eaae02
### Summary This PR stops the V2 subscription message processor from acknowledging keep-alive sequence numbers and adds a regression test that verifies acknowledgements are only queued for notification messages that actually contain data. ### Problem According to OPC UA Part 4 publish semantics, a keep-alive `NotificationMessage` does not acknowledge delivery of a real notification. Its `SequenceNumber` identifies the next notification message that will be sent, not a notification payload that the client has already received. Previously, `MessageProcessor.ProcessMessageAsync()` correctly treated `NotificationData.Count == 0` as a keep-alive and intentionally avoided advancing the data-message deduplication gate. However, `OnNotificationReceivedAsync()` still unconditionally queued a `SubscriptionAcknowledgement` for every message, including empty keep-alives. As a result, the V2 client could acknowledge a future sequence number before the corresponding data/event notification had actually been received. This could produce spurious acknowledgement noise against strict servers and made the V2 path inconsistent with the existing classic subscription engine, which only acknowledges messages that contain notification data. ### Changes - Stop queueing acknowledgements for keep-alive messages in `MessageProcessor.OnNotificationReceivedAsync()`. - Preserve the existing keep-alive dispatch path and continue acknowledging notification messages that carry real data. - Extend the message processor tests to verify that keep-alives do not enqueue acknowledgements and that the subsequent real notification still does.