Defect #44431
openmentions can't find a user
Description
while using `` for the user mention, redmine can't match input after to a real user if numer of project users is significant
main reason is that there is a logic flaw
WatchersController is defining `users_for_mention` method
logic is:
```
if params[:q].blank? && @project.present?
scope = @project.principals.assignable_watchers.limit(100)
else
scope = Principal.assignable_watchers.limit(10)
end
```
that mean if you press `@` in the issue text editor, first 10 users are being selected and then query filter is applied, so if you user is 11th on a list - there sill be an empty list
I suggest to not limit `scope` there, but after matching users to a query
Updated by Janusz Harkot about 16 hours ago
there are performance changes Patch #44190: Improve @mention performance by limiting initial suggestions should be addressed too... is there an option to send quary (`q`) to the database - to limit matched users?