After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773554 - Tasks duplicate themselves between or within lists, then disappear
Tasks duplicate themselves between or within lists, then disappear
Status: RESOLVED FIXED
Product: gnome-todo
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME To Do maintainer(s)
GNOME To Do maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-10-26 20:27 UTC by Daniel Boles
Modified: 2016-10-27 01:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
examples of 'duplicated' tasks between/within different lists (1.49 MB, video/webm)
2016-10-26 20:27 UTC, Daniel Boles
  Details
task-list-view: fix newly-created task not being removed (1.84 KB, patch)
2016-10-27 00:10 UTC, Georges Basile Stavracas Neto
committed Details | Review

Description Daniel Boles 2016-10-26 20:27:50 UTC
Created attachment 338544 [details]
examples of 'duplicated' tasks between/within different lists

There are some very strange interactions between adding a task and switching to a different list. These cause tasks to be shown in other lists than their own, or duplicated multiple times within their own list. But if you then switch away and back to the list, it will look OK... usually! Sometimes you get a _3rd_ copy. :P

I think this is purely a presentation issue, as deleting one of the duplicates will make them all vanish. And again, some conditions force the view to fix itself.

I don't know the exact patterns yet, will try to figure them out, but for now, I'll just dump a couple of screencasts! then go test some more.
Comment 1 Daniel Boles 2016-10-26 20:29:52 UTC
Here's the simplest case:

* Create 2 lists: List A, List B
* Add a Task A to List A
* Go to List B
* Task A is there!
* Go back to List A
* Two copies of Task A are there!
* Go to List B again...
* It's fine now
* And so is List A!
Comment 2 Daniel Boles 2016-10-26 20:58:20 UTC
somehow there are a pile of calls to gtd_task_list_view_set_list where the argument list is NULL, but I can't see where those would be coming from...
Comment 3 Daniel Boles 2016-10-26 21:05:58 UTC
[reads docs] duh, that argument is explicitly nullable.
Comment 4 Daniel Boles 2016-10-26 21:30:09 UTC
The problem seems to be that in the remove_task() function, the offending rows still have new-task-mode set, so they do not get removed. However they are clearly not in new task mode, because the label is shown, rather than the entry. This property somehow is not updated soon enough.
Comment 5 Daniel Boles 2016-10-26 21:34:15 UTC
No, sorry... I was passing the wrong pointer to my check for new-task-mode. So that can't be the reason why the list rows are not being deleted when they should. Please disregard that, and I will stop making terrible guesses now. :)
Comment 6 Georges Basile Stavracas Neto 2016-10-27 00:10:37 UTC
Created attachment 338557 [details] [review]
task-list-view: fix newly-created task not being removed

When the user creates the tasklist, the task is not added to the
tasks' GList, and we eventually fail to remove it (since it's not
in the list).

Fix that by properly adding the task to the internal list of tasks.
Comment 7 Georges Basile Stavracas Neto 2016-10-27 00:12:24 UTC
Thanks for the report.

Attachment 338557 [details] pushed as 2cfba61 - task-list-view: fix newly-created task not being removed
Comment 8 Daniel Boles 2016-10-27 01:41:42 UTC
Works great now, thanks for the quick fix!