Fix HistoryRead bit not set in Server object EventNotifier when history capabilities are enabled#3252
Merged
Conversation
|
|
…ry capabilities Co-authored-by: romanett <[email protected]>
Copilot
AI
changed the title
[WIP] Fix HistoryRead bit in EventNotifier for Server object
Fix HistoryRead bit not set in Server object EventNotifier when history capabilities are enabled
Oct 10, 2025
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3252 +/- ##
==========================================
+ Coverage 57.85% 58.00% +0.15%
==========================================
Files 365 365
Lines 79806 79829 +23
Branches 13882 13885 +3
==========================================
+ Hits 46171 46307 +136
+ Misses 29490 29387 -103
+ Partials 4145 4135 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…read-bit-server-object
romanett
marked this pull request as ready for review
October 13, 2025 04:41
romanett
approved these changes
Oct 13, 2025
romanett
left a comment
Contributor
There was a problem hiding this comment.
The History Read / Write bits are correctly set now in the Server Object
…read-bit-server-object
marcschier
approved these changes
Oct 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When implementing an OPC UA server with event history support, the HistoryRead bit (0x04) in the EventNotifier attribute of the Server object was not being set, even when
AccessHistoryEventsCapabilitywas configured to true in the ServerCapabilities. This prevented OPC UA clients from discovering that the server supports historical event reads on the Server object.According to the OPC UA specification, when a server supports history read capabilities, the Server object's EventNotifier should have the HistoryRead bit set to indicate this capability to clients.
Solution
This PR implements a systematic approach to synchronize the Server object's EventNotifier with the configured history capabilities:
1. New Virtual Method in DiagnosticsNodeManager
Added
UpdateServerEventNotifier()method that:AccessHistoryEventsCapabilityorAccessHistoryDataCapabilityis enabledpublic virtualto allow customization in derived classes2. Automatic Initialization in ServerInternalData
Modified
CreateServerObject()to:GetDefaultHistoryCapabilities()to ensure history capabilities are initializedUpdateServerEventNotifier()to update the Server EventNotifier based on the configured capabilities3. Integration Test
Added
ServerEventNotifierHistoryReadBittest in ReferenceServerTest.cs that verifies:AccessHistoryEventsCapabilityandAccessHistoryDataCapabilityExample Usage
After this fix, servers with history capabilities enabled will automatically have the correct EventNotifier bits set:
For runtime updates:
Compatibility
Addresses
Fixes the issue described in the original problem statement where setting
AccessHistoryEventsCapabilityto true should result in the HistoryRead bit being set on the EventNotifier attribute of the Server object.Co-authored-by: @romanett
Original prompt
Fixes #2081
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.