Defect #35192
openWatchers pop up window appears after a long time
Added by Jean-René ROUET over 5 years ago. Updated 4 days ago.
Description
Hi
patch #33329 introduces a performance issue
When you want to add a watcher to an issue in a project with many collaborators, the pop-up window take between 10 sec and 20 sec (according to the number of collaborators) to appear.
It's very disturbing because user has no graphical indication about that.
regards
Files
| watcher-dialog-load-more.patch (9.46 KB) watcher-dialog-load-more.patch | Takenori TAKAKI, 2026-07-30 06:30 |
Related issues
Updated by Marius BĂLTEANU over 5 years ago
- Related to Patch #33329: Improve watchers functionality to mark the users that are watching a non visible object and to not return watchers that cannot see the object added
Updated by Marius BĂLTEANU over 5 years ago
How many members do you have on the project where you experience this issue? (rounded number).
In #33329, I've proposed two options (4 and 5) to avoid this performance issue, which one works better for you?
Updated by Jean-René ROUET over 5 years ago
Hi
when it took 10 seconds to pop up, there is 900 members.
when it took 25 seconds, there is 2500 members.
it's linear
I prefer the option 4
Updated by Simon Hori over 4 years ago
Hello Marius,
Thank you for the patch #33329 that is good improvement for sure.
But we do have the same perfomance problem with 1300+ users.
watchable_object.visible?(user)is making at least two SQL queries per user.
I don't think we need all users names listed when the search query is blank. so I would like to request option 4.
As a test, I made this change and it reduced loading time from 4 sec to 0.2 sec.
- scope = @project.principals.assignable_watchers
+ scope = @project.principals.assignable_watchers.limit(100)
Updated by Benoît Yegre almost 4 years ago
Hello
We have the same problem that watchers pop up window appears after a long time.
Config :
Environment: Redmine version 4.2.8.stable Ruby version 2.7.6-p219 (2022-04-12) [x86_64-linux] Rails version 5.2.8.1 Environment production Database adapter PostgreSQL Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Subversion 1.14.1 Mercurial 5.6.1 Bazaar 3.1.0 Git 2.30.2 Filesystem Redmine plugins: redmine_openid_connect 0.9.4
We have 3 000 users and when we want add watchers for an issue, it takes a while to appear the watchers box (20 seconds).
Is there a solution ?
- like limiting watchers for a project ...
Thank you for your help.
Updated by Guillermo ML almost 3 years ago
We have hit the same performance problems.
We have a project with 1125 members, it takes ~4s to show the windows and another ~3 to see the watcher added.
On projects with few users the action is almost immediate.
Our configurationOur configuration
Environment: Redmine version 5.0.5.stable Ruby version 2.7.6-p219 (2022-04-12) [x86_64-linux] Rails version 6.1.7.2 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp Redmine settings: Redmine theme Purplemine2-2.14.0 SCM: Subversion 1.10.2 Mercurial 4.8.2 Git 2.31.1 Filesystem Gitlab 4.14.0 Redmine plugins: redmine_agile 1.6.5 redmine_gitlab_adapter 0.2.1 view_customize 3.3.0
Updated by Dmitrijs Migunovs over 1 year ago
5.1.3.stable - same issue. We have 242 users, and the Watchers pop-up takes about 5-10 seconds to open.
Member Load (32.1ms) SELECT `members`.* FROM `members` INNER JOIN `projects` ON `projects`.`id` = `members`.`project_id` WHERE `members`.`user_id` = 274 AND `projects`.`status` != 9 AND `members`.`project_id` = 8 ORDER BY `members`.`id` ASC LIMIT 1 Role Load (32.1ms) SELECT DISTINCT `roles`.* FROM `roles` INNER JOIN `member_roles` ON `roles`.`id` = `member_roles`.`role_id` WHERE `member_roles`.`member_id` = 5706
Updated by Takenori TAKAKI 4 days ago
Following the discussion here and the "option 4" idea in #33329, here is a patch that takes a "Load more" approach rather than a hard limit. It applies on current trunk.
A hard limit fixes the slowness but hides the members beyond it when no search term is entered. This patch shows the first 100 members and lets users load the rest via "Load more", so no one becomes unreachable. Search is unchanged (already limited to 100).