-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
$allowMedialSearches = $this->config->getSystemValue('accounts.enable_medial_search', true); |
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 |
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
@VicDeo Could you rebase and push? |
After rebase you will get the new changelog generator templates. |
@micbar done |
Description
Add
matchMode
search option for carddav backend. Make itany
by default and switch tostart
when 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:cron
occ federation:sync-addressbooks
5 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: