-
Notifications
You must be signed in to change notification settings - Fork 954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Server] Add support for SupportsFilteredRetain #2913
base: master
Are you sure you want to change the base?
[Server] Add support for SupportsFilteredRetain #2913
Conversation
Contains test debug messages that should be cleaned up
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2913 +/- ##
==========================================
+ Coverage 55.40% 55.65% +0.24%
==========================================
Files 352 352
Lines 67605 67644 +39
Branches 13851 13860 +9
==========================================
+ Hits 37456 37645 +189
+ Misses 26044 25873 -171
- Partials 4105 4126 +21 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
Libraries/Opc.Ua.Server/Subscription/MonitoredItem.cs:1086
- [nitpick] The method name 'CanSendFilteredAlarm' is ambiguous. Consider renaming it to 'ShouldSendFilteredAlarm' to better reflect its purpose.
protected bool CanSendFilteredAlarm(FilterContext context, EventFilter filter, IFilterTarget instance)
Libraries/Opc.Ua.Server/Subscription/MonitoredItem.cs:1086
- The new behavior introduced by 'CanSendFilteredAlarm' should be covered by tests to ensure it works as expected.
protected bool CanSendFilteredAlarm(FilterContext context, EventFilter filter, IFilterTarget instance)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
Libraries/Opc.Ua.Server/Subscription/MonitoredItem.cs:1045
- [nitpick] The method name 'CanSendFilteredAlarm' is ambiguous and does not clearly convey its purpose. Consider renaming it to 'ShouldSendFilteredAlarm' to better reflect its functionality.
if ( !CanSendFilteredAlarm( context, filter, instance ) )
Libraries/Opc.Ua.Server/Subscription/MonitoredItem.cs:1135
- The comment includes a date 'December 17 2024' which may be a typo or placeholder. Ensure the date is correct or remove it if unnecessary.
// Archie - December 17 2024
Libraries/Opc.Ua.Server/Subscription/MonitoredItem.cs:1144
- The variable 'saved' is used without being initialized in some cases. Ensure 'saved' is properly initialized before use to avoid potential null reference errors.
if ( saved )
alarmCondition.SupportsFilteredRetain.Value && | ||
filter.SelectClauses != null) | ||
{ | ||
int lastIndex = filter.SelectClauses.Count - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does lastIndex allways point to the ConditionId ? Can't the client request it in another order together with other SelectClauses?
|
||
bool canSend = passedFilter; | ||
|
||
// ConditionId is valid only if FilteredRetain is set for the alarm condition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the ConditionId only valid if FilteredRetain is set ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is specifically for SupportsFilterRetain, so if it is not set, the remainder of the function is not required, only the filter check at the top of the function.
This is still a work in progress, I'm going to move it to draft for now.
Proposed changes
Add support for SupportsFilteredRetain - Issue 2142
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.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.Further comments
One potential issue is that the ConditionState SupportsFilteredRetain property should be handled by the ObjectModeller. When this is implemented, this property and member variable will need to be removed.