-
Notifications
You must be signed in to change notification settings - Fork 351
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
Fixes for addressbook-query filters #1322
Fixes for addressbook-query filters #1322
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1322 +/- ##
=========================================
Coverage 97.12% 97.13%
- Complexity 2788 2789 +1
=========================================
Files 174 174
Lines 8045 8050 +5
=========================================
+ Hits 7814 7819 +5
Misses 231 231
Continue to review full report at Codecov.
|
There is another issue in the same function. A negated text-match should match when a parameter value is found that does not match the search string. However, the current code requires there is no such parameter value. This is a problem if there are multiple instances of the property, where at least one matches the non-negated text-match filter, but there is also another one that matches the negated text-match filter. In this case, the function would filter out the card, because it searches for a property that matches the non-negated filter, and then stops and inverts the end result. Example:
A Relevant parts of RFC 6352:
|
There appears to be the same problem with negated text-matches at the prop-filter level. Fixed that as well. |
The negation applies to the individual text-match (i.e. the negated text-match matches if a parameter string does not match the search string). It does not apply to the entire param-filter (i.e. it does not mean there must be NO property instance that matches the param filter, it is sufficient if there is one that does not match).
The negate-condition attribute applies to the individual text-match, not the result of applying the non-negated match against all property instances of the asked for type.
568c60d
to
b5792d3
Compare
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.
LGTM - tests fail before the changes, and pass with the code changes, good stuff.
I rebased. Let's see how many hours delay Travis has today! |
A null dereference occurs when a param-filter is checked on a property that does not have this parameter set. I adapted the tests by simply rearranging the test data set so that a TEL property without TYPE parameter comes before those with TYPE parameters to trigger the situation in the existing tests.
A log trace for your reference: