Project

General

Profile

Actions

Defect #34247

closed

Web browser freezes when displaying workflow page with a large number of issue statuses

Added by Andrea Valle about 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Administration
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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


Files


Related issues

Related to Redmine - Patch #31441: Show elements titles using jQuery UI tooltipsClosedGo MAEDA

Actions
Related to Redmine - Patch #35034: Improve loading speed of workflow pageClosedGo MAEDA

Actions
Actions #1

Updated by Andrea Valle about 4 years ago

Note: There is an indentation error in the yml.

redmine_data:
driver: local

must go left as the above maria_db volume.

Actions #2

Updated by Andrea Valle about 4 years 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.

Actions #3

Updated by Marius BĂLTEANU about 4 years ago

  • Assignee set to Marius BĂLTEANU
Actions #4

Updated by Andrea Valle about 4 years 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.

Actions #5

Updated by Marius BĂLTEANU about 4 years ago

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.

Actions #6

Updated by Marius BĂLTEANU about 4 years ago

  • Assignee deleted (Marius BĂLTEANU)

andrea andrea Valle, can you test this solution and tell me if works for you?

Actions #7

Updated by Go MAEDA almost 4 years 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
Actions #8

Updated by Go MAEDA almost 4 years 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.

Actions #9

Updated by Go MAEDA almost 4 years 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.

Actions #10

Updated by Go MAEDA almost 4 years ago

  • Status changed from Resolved to Closed
Actions #11

Updated by Go MAEDA almost 4 years ago

  • Related to Patch #31441: Show elements titles using jQuery UI tooltips added
Actions #12

Updated by Go MAEDA over 3 years ago

  • Related to Patch #35034: Improve loading speed of workflow page added
Actions

Also available in: Atom PDF