LibrePlan / libreplan

LibrePlan - Open Web Planning
https://www.libreplan.dev
GNU Affero General Public License v3.0
287 stars 170 forks source link

Dependencies bad removed in gantt #1507

Closed kwoot closed 6 years ago

kwoot commented 12 years ago

(Original Bugzilla Bug ID: 1363)

Date: 2012-01-25 12:38:09 From: Javier Morán \<jmoran@igalia.com> To: Jacobo Aragunde Perez \<jaragunde@igalia.com> Version: libreplan-1.2 (1.2.x) Last updated: 2012-02-15 16:50:12


(Note: this issue was migrated automatically with bugzilla2github.py tool )

kwoot commented 6 years ago

Bugzilla Comment ID: 3692 Date: 2012-01-25 12:38:09 From: Javier Morán \<jmoran@igalia.com>

If you do the following operations in the gantt a wrong dependency is drawed.

At this point you can see that there two dependencies from Task A to Task B, the initial END-START seems not correctly removed.

Two notes: This also happens with filtering and probably with another type of dependency.

kwoot commented 6 years ago

Bugzilla Comment ID: 3734 Date: 2012-02-10 11:26:39 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

This seems to be an issue in the graphical part of the application and not in the model, because after saving, closing and opening the project again, only one dependency appears. I'll investigate this a bit, in any case.

kwoot commented 6 years ago

Bugzilla Comment ID: 3735 Date: 2012-02-10 11:49:37 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

Inde(In reply to comment #1)

This seems to be an issue in the graphical part of the application and not in the model, because after saving, closing and opening the project again, only one dependency appears. I'll investigate this a bit, in any case.

Indeed, I've checked that the old end-start dependency doesn't exist in the model. But somehow it still exists in the view, so we have to check how dependencies are drawn when a container is opened, check where they are stored and ensure that they are removed correctly when it's needed.

kwoot commented 6 years ago

Bugzilla Comment ID: 3736 Date: 2012-02-10 13:07:27 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

There are three levels in which a list of dependencies is being maintained:

kwoot commented 6 years ago

Bugzilla Comment ID: 3737 Date: 2012-02-10 16:02:14 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

Another note: this bug can be reproduced with the following steps:

kwoot commented 6 years ago

Bugzilla Comment ID: 3738 Date: 2012-02-13 15:22:27 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

I'm starting to think this could be a bug in the framework. In theory, the delete operation in DependencyList (method remove(Dependency)) went well, and after the removal there are no children in DependencyList. But when we close and open the container again, the method redrawDependencies(), which calls getChildren(), returns one dependency.

Also, it's strange we didn't realize in all this time, so I will test if this happened with previous versions of ZK.

kwoot commented 6 years ago

Bugzilla Comment ID: 3740 Date: 2012-02-14 12:10:34 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

I finally found the cause of the bug. When a new dependency is created, a listener object DependencyVisibilityToggler related to the dependency is created (see DependencyList.addDependencyComponent). This listener is used to hide and show the dependencies depending on the visibility state of their related tasks.

When the dependency is removed, the listener object is not removed, it keeps existing. For that reason, the listener is run when the tasks are opened again (in TaskList.addPendingTasks, the visibility is set to true), and the dependency is again added to the tree.

kwoot commented 6 years ago

Bugzilla Comment ID: 3742 Date: 2012-02-14 16:58:10 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

commit 2d7ea169bcffb380124217e3797c8d2b1063ad75 Author: Jacobo Aragunde Pérez jaragunde@igalia.com Date: Tue Feb 14 16:17:46 2012 +0100

Bug #1363: Remove visibility listeners corresponding to deleted tasks.

To do that we had to add an attribute in DependencyComponent to store the
listener and a method in Task to be able to delete visibility listeners.

This listener was causing that deleted tasks re-appeared when containers were
closed and opened again.

FEA: ItEr76S04BugFixing
kwoot commented 6 years ago

Bugzilla Comment ID: 3743 Date: 2012-02-14 16:59:21 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

As a bonus, I wrote some additional patches in the code I had to study for this bug, to improve performance:

commit 2664999c4d72b0e352c821450e0752398ac52178 Author: Jacobo Aragunde Pérez jaragunde@igalia.com Date: Tue Feb 14 16:35:19 2012 +0100

Remove redraw listeners for dependencies once these dependencies are removed.

This change should improve performance when working in a gantt in which some
dependencies were removed.

FEA: ItEr76S04BugFixing

commit fe9eb3b4525d0a570a52c62dd0c604df36d480f5 Author: Jacobo Aragunde Pérez jaragunde@igalia.com Date: Tue Feb 14 16:26:12 2012 +0100

Prevent unnecessary redraws of dependencies when opening a container.

Redraw was being done every time a task was rendered and one last time when all
the tasks are rendered. Doing only the last redraw is enough.

This change should improve performance when opening containers.

FEA: ItEr76S04BugFixing
kwoot commented 6 years ago

Bugzilla Comment ID: 3750 Date: 2012-02-15 16:50:12 From: Jacobo Aragunde Perez \<jaragunde@igalia.com>

(In reply to comment #7)

commit 2d7ea169bcffb380124217e3797c8d2b1063ad75 Author: Jacobo Aragunde Pérez jaragunde@igalia.com Date: Tue Feb 14 16:17:46 2012 +0100

Bug #1363: Remove visibility listeners corresponding to deleted tasks.

To do that we had to add an attribute in DependencyComponent to store the
listener and a method in Task to be able to delete visibility listeners.

This listener was causing that deleted tasks re-appeared when containers

were closed and opened again.

FEA: ItEr76S04BugFixing

I completely screwed the description in this patch, I meant 'deleted dependencies' when I said 'deleted tasks' (twice).