Take accounts.enable_medial_search into account while searching for remote users in share autocomplete#36225
Conversation
Codecov Report
@@ Coverage Diff @@
## master #36225 +/- ##
============================================
+ Coverage 64.83% 64.84% +<.01%
- Complexity 19762 19768 +6
============================================
Files 1271 1271
Lines 74675 74697 +22
Branches 1309 1309
============================================
+ Hits 48418 48434 +16
- Misses 25871 25877 +6
Partials 386 386
Continue to review full report at Codecov.
|
44cad55 to
e55f4ba
Compare
There was a problem hiding this comment.
The code looks okay and it is working like expected. But, I have some doubts about the architecture.
Since accounts.enable_medial_search is a system value, I feel like it should be forced in core implementation. In my POV, it should not be an option. The other usages of the same system value are also in this way. It is not selectable by API consumers like this one
core/lib/private/User/AccountMapper.php
Line 156 in bd3df85
In this implementation, we expect every class which uses ContactManager or CardDAV backend search to be aware of this system config and send the correct option to obey the configured setting. Also when I look at ContactManager interface or its implementation, I can not see which are these search options.
I may have missed something, but I would keep it simple and just add a check in the CardDAV search for this config.
|
@karakayasemi there is an internal conflict there. Such kind of dependency might have side effects while working with address books and doing an ordinary search in user contacts |
|
@VicDeo Could you rebase and push? |
|
After rebase you will get the new changelog generator templates. |
|
@micbar done |
Description
Add
matchModesearch option for carddav backend. Make itanyby default and switch tostartwhen accounts medial search is offRelated Issue
Motivation and Context
Use medial search only if it is enabled when searching for users synced via federation app
How Has This Been Tested?
occ system:cronocc federation:sync-addressbooks5 Try share autocomplete using the middle chars of remote users usernames
Expected
No remote users in autocomplete as medial search is off
Actual
Remote users with the search patterns in the middle of username are still proposed
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: