backlogs / redmine_backlogs

A Redmine plugin for agile teams
https://backlogs.github.io/www/
GNU General Public License v2.0
773 stars 460 forks source link

'closed' versions or releases should be excluded from droppables #1158

Open fuminori-ido-m opened 1 year ago

fuminori-ido-m commented 1 year ago

In lib/backlogs_project_patch.rb, ProjectPatch::InstanceMethods#_sql_for_droppables gather infos of [projects.id, versions/releases ids under the projects], which will be used to check a story can be dragged&dropped on the page.

When the number of versions and/or releases become large, two problems arise:

A) the SQL takes long time (e.g. 26 seconds under Versions.count ~= 900 and projects.count ~= 240 our case). B) In MySQL, GROUP_CONCAT default max length is 1024 chars so that the _sql_for_droppables method easily exeeds at our case; the result is chopped so that incorrect value is returned.

Solution for A

I think the closed versions and releases should be excluded from droppables because they are not used at backlog page, am I right?

Our team has already proceeded the PR at our forked repository (because drag&drop doesn't work anyway since project-tree issue(see #1157 )), but I would like to confirm here that my understanding and solution for A is right or not.