-
Notifications
You must be signed in to change notification settings - Fork 155
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
Fix server error while filtering with special characters #606
Fix server error while filtering with special characters #606
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #606 +/- ##
============================================
- Coverage 47.33% 44.41% -2.93%
- Complexity 1130 1160 +30
============================================
Files 41 41
Lines 9141 10139 +998
Branches 2432 2812 +380
============================================
+ Hits 4327 4503 +176
- Misses 3886 4677 +791
- Partials 928 959 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
switch (attributeName) { | ||
case SCIMConstants.RoleSchemaConstants.DISPLAY_NAME_URI: | ||
searchFilter = ROLE_NAME_FILTER_ATTRIBUTE + " " + filterOperation + " " + attributeValue; | ||
searchFilter = ROLE_NAME_FILTER_ATTRIBUTE + " " + filterOperation + " " + formattedAttributeValue; |
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.
Can you point out where these values are handled later in the flow?
Previously, the attribute value didn't include any operator-specific logic, but now with formattedAttribute, it does. I’d like to understand how this affects subsequent processing. Are there any changes in how these formatted values are utilized in query construction or filtering logic?
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.
Refer #606 (comment).
For an inference nf how the list of expression nodes derived from the filter string is utilized to construct the SQL query, refer to RoleDAOImpl.java (Line 396).
* @param attributeValue Value of the attribute | ||
* @return Formatted attribute value for search | ||
*/ | ||
private String formatSearchAttributeValue(String filterOperation, String attributeValue) { |
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.
Did we test this with multiple filters.
name co and
How this is processed through the filtering nodes.
As there is no value after and operation, if we can process and
part as a value.
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.
When using a filter like:
name co and
,
and
is treated as part of the search value (not a logical operator). For more information refer #606 (comment)
Upon calling the For example, if the filter string is Next, the listRolesWithGET() method is invoked, which internally invokebuildSearchFilter(), which constructs and returns the search filter string ( Within the role service layer, getExpressionNodes() is called, utilizing the FilterTreeBuilder class to construct the filter tree. The root cause of the internal server error occurs at this stage. Within FilterTreeBuilder.java, the filter expression list(token list) remains unchanged: To resolve this issue, two possible solutions are available:
The first approach is preferable as it ensures correct filtering logic before reaching the service layer, preventing unnecessary complexities in |
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
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.
Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/13175259984
Closing this pr as it was decided to proceed with the |
Purpose
Screen.Recording.2025-02-05.at.12.44.47.mov