Vote #81135
完了Web browser freezes when displaying workflow page with a large number of issue statuses
0%
説明
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
journals
Note: There is an indentation error in the yml.
redmine_data:
driver: local
must go left as the above maria_db volume.
--------------------------------------------------------------------------------
I found the issue.
The problem is inside:
public/javascripts/application.js
inside this function:
<pre>
$(function () {
$('[title]').tooltip({
show: {
delay: 400
},
position: {
my: "center bottom-5",
at: "center top"
}
});
});
</pre>
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.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
As a workaround at the moment I changed the line:
<pre>
$('[title]').tooltip({
</pre>
with this:
<pre>
$("body:not('.controller-workflows.action-edit') [title]").tooltip({
</pre>
It disables redmine tooltip on that page.
However browser still renders tooltip with its default behaviuor.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
@Andrea Valle, can you test this solution and tell me if works for you?
--------------------------------------------------------------------------------
Thank you for posting the patch but I found that the patch breaks an existing test.
<pre>
$ 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
</pre>
Applying the following patch before/after attachment:disable_tooltip_in_workflow_status_transition.patch fixes the error.
<pre><code class="diff">
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
</code></pre>
--------------------------------------------------------------------------------
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 attachment:disable_tooltip_in_workflow_status_transition.patch soon.
--------------------------------------------------------------------------------
Committed the fix. Thank you for your contribution.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
related_issues
relates,Closed,31441,Show elements titles using jQuery UI tooltips
relates,Closed,35034,Improve loading speed of workflow page