-
Notifications
You must be signed in to change notification settings - Fork 715
fix: null check in conditions #9449
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
Conversation
|
Failed to generate code suggestions for PR |
Greptile OverviewGreptile SummaryFixed null value handling in alert condition evaluation and string comparison logic:
Both changes improve the robustness of alert condition evaluation when dealing with null values and quoted strings in JSON data. Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Alert System
participant ConditionExt
participant Value Handler
User->>Alert System: Trigger alert evaluation
Alert System->>ConditionExt: evaluate(row)
ConditionExt->>ConditionExt: Get column value from row
alt Column not found
ConditionExt-->>Alert System: return false
else Column found
ConditionExt->>Value Handler: Match on value type
alt Value::String
Value Handler->>Value Handler: trim_matches('"') on condition value
Value Handler->>Value Handler: Compare strings with operator
Value Handler-->>ConditionExt: Return comparison result
else Value::Number
Value Handler->>Value Handler: Parse and compare numbers
Value Handler-->>ConditionExt: Return comparison result
else Value::Bool
Value Handler->>Value Handler: Parse and compare booleans
Value Handler-->>ConditionExt: Return comparison result
else Value::Null (NEW)
Value Handler->>Value Handler: Check if operator is EqualTo
Value Handler->>Value Handler: Check if condition value is "null" string
Value Handler-->>ConditionExt: Return true if both match
else Other types
Value Handler-->>ConditionExt: return false
end
ConditionExt-->>Alert System: Return evaluation result
end
Alert System-->>User: Alert triggered or not
|
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.
1 file reviewed, 1 comment
fixes #9443