Defect #34247
Web browser freezes when displaying workflow page with a large number of issue statuses
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Administration | |||
Target version: | 4.1.2 | |||
Resolution: | Fixed | Affected version: | 4.1.1 |
Description
Hello,
I have a Remidne 4.1 installation with about 100 issue statuses.
When I visit workflow edit page and unset "Only display statuses that are used by this tracker" checkbox, if I press "edit" button browser hangs.
I reproduced this also with a "fresh" installation.
I attached a docker-compose file by which I created the "fresh" installation.
Once the sistem is up, I created issue statuses by following these steps:
$ docker-compose up $ docker-compose exec redmine bash > cd /opt/bitnami/redmine > bundle exec rails console -e production irb(main):001:0> (1..100).each { |i| IssueStatus.create(name: "issue status: #{i}") }
And then visit the workflow page.
Thank you.
This is my environment:
Environment: Redmine version 4.1.1.stable Ruby version 2.6.6-p146 (2020-03-31) [x86_64-linux] Rails version 5.2.4.2 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Git 2.29.2 Filesystem Redmine plugins: no plugin installed
Related issues
Associated revisions
Fix that WorkflowsControllerTest fails if table cells have more than one CSS class (#34247).
Patch by Go MAEDA.
Web browser freezes when displaying a workflow page with a large number of issue statuses (#34247).
Patch by Marius BALTEANU.
History
#1
Updated by Andrea Valle 2 months ago
Note: There is an indentation error in the yml.
redmine_data:
driver: local
must go left as the above maria_db volume.
#2
Updated by Andrea Valle 2 months ago
I found the issue.
The problem is inside:
public/javascripts/application.js
inside this function:
$(function () { $('[title]').tooltip({ show: { delay: 400 }, position: { my: "center bottom-5", at: "center top" } }); });
If I count the title attributes in the page with 100 issue statuses, I have 34454 items.
When I remove this code, the page loads correctly.
However I do not know the right way to fix it.
Hope this can help the fix.
#3
Updated by Marius BALTEANU 2 months ago
- Assignee set to Marius BALTEANU
#4
Updated by Andrea Valle about 1 month ago
As a workaround at the moment I changed the line:
$('[title]').tooltip({
with this:
$("body:not('.controller-workflows.action-edit') [title]").tooltip({
It disables redmine tooltip on that page.
However browser still renders tooltip with its default behaviuor.
#5
Updated by Marius BALTEANU about 1 month ago
- File disable_tooltip_in_workflow_status_transition.patch
added
- Target version set to 4.1.2
The attached patch changes the tooltip selector in order to ignore elements with class no-tooltip
and add this class to all cells from workflow status transitions tab.
What else we can do is to add this class only when there are more than x transitions.
#6
Updated by Marius BALTEANU about 1 month ago
- Assignee deleted (
Marius BALTEANU)
@Andrea Valle, can you test this solution and tell me if works for you?
#7
Updated by Go MAEDA 19 days ago
Thank you for posting the patch but I found that the patch breaks an existing test.
$ ruby test/functional/workflows_controller_test.rb Run options: --seed 54329 # Running: ...F Failure: WorkflowsControllerTest#test_get_edit_should_show_checked_disabled_transition_checkbox_between_same_statuses [test/functional/workflows_controller_test.rb:125]: Expected at least 1 element matching "td[title='New » New'][class="enabled"]", found 0.. Expected 0 to be >= 1. bin/rails test test/functional/workflows_controller_test.rb:122
Applying the following patch before/after disable_tooltip_in_workflow_status_transition.patch fixes the error.
Index: test/functional/workflows_controller_test.rb
===================================================================
--- test/functional/workflows_controller_test.rb (リビジョン 20700)
+++ test/functional/workflows_controller_test.rb (作業コピー)
@@ -125,7 +125,7 @@
assert_select 'table.workflows.transitions-always tbody tr:nth-child(2)' do
assert_select 'td.name', :text => 'New'
# assert that the td is enabled
- assert_select "td[title='New » New'][class=?]", 'enabled'
+ assert_select "td.enabled[title='New » New']"
# assert that the checkbox is disabled and checked
assert_select "input[name='transitions[1][1][always]'][checked=?][disabled=?]", 'checked', 'disabled', 1
end
#8
Updated by Go MAEDA 7 days ago
Marius BALTEANU wrote:
The attached patch changes the tooltip selector in order to ignore elements with class
no-tooltip
and add this class to all cells from workflow status transitions tab.
I have confirmed the problem with 100 statuses. After applying the patch, Chrome finishes loading the page in 20 seconds and does not display "Page unresponsive" dialog box.
I will commit #34247#note-7 and disable_tooltip_in_workflow_status_transition.patch soon.
#9
Updated by Go MAEDA 5 days ago
- Subject changed from Show Workflow for all statuses hangs with about 100 issue statuses to Web browser freezes when displaying workflow page with a large number of issue statuses
- Category changed from Issues workflow to Administration
- Status changed from New to Resolved
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the fix. Thank you for your contribution.
#11
Updated by Go MAEDA 3 days ago
- Related to Patch #31441: Show elements titles using jQuery UI tooltips added