GTG

"Tasks with no tags" count is wrong

Bug #583330 reported by Luca Invernizzi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
Fix Released
Medium
Unassigned

Bug Description

From Bryce's words:

 'Tasks with no tags' appears to be wildly off, and seem to be set to a different value each time the program is restarted with WorkView turned on. I've seen 233, 760, 494, and 405 reported, when gtg 0.2.x is (correctly, consistently) reporting 130 or so. The total number of tasks I have is some amount over 700.

The counts for the individual tag entries are all correct, it's just the two filter-based items that are inaccurate.

If I switch off Work View, it also reports incorrect numbers. It shows the total as 1143 when it should be in the 700's. Toggling WorkView on and off seems not to cause the numbers to recalculate, it just switches between 494 and 1143 or whatever.

Tags: regression

Related branches

Changed in gtg:
assignee: nobody → Luca Invernizzi (invernizzi)
Changed in gtg:
assignee: Luca Invernizzi (invernizzi) → nobody
Revision history for this message
Bryce Harrington (bryce) wrote :

Today it is showing the correct count (3) when the WorkView is turned on, but when it's off it says 55 (where there are only 5 displayed).

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

Yep. From my little search, it seems it is caused by subtasks.

Revision history for this message
Bryce Harrington (bryce) wrote : Re: [Bug 583330] Re: "Tasks with no tags" count is wrong

On Mon, May 24, 2010 at 05:20:56PM -0000, Luca Invernizzi wrote:
> Yep. From my little search, it seems it is caused by subtasks.

Yeah, in studying it further I think I agree. Looking through the tags,
the counts are incorrect for tags that have a lot of tasks, so I guess
it may be counting parent tasks that are active and started but not
workable.

Revision history for this message
Bryce Harrington (bryce) wrote :

Er, wait... comparing against gtg 0.2 it seems the tasks displayed in
the workviews differ for me from 0.2 and 0.3. At least in the case I
was looking at, the *count* of tasks in 0.3 was correct but it was
omitting tags that it shouldn't. Erf.

Anyway, forget my previous comment. It seems gtg's filters are being
screwy. Sounds like you have a good idea what's going wrong though.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

I see a lot of bugs related to task count. Correct me if I'm wrong :

1) every task count is related to a FilteredTree
2) FilteredTree provides get_nodes_count which, according to my tests, is always right

Thus, I think that we should ensure that our task count is coming from FilteredTree and not from a random local way of counting.

Mmmm, not so sure anymore about 1). Do we create the FilteredTree only when clicking on a specific tag ? Thus, it might be a bad idea to create at start a FilteredTree for every tag. It also means that every FilteredTree instance is updated whenever something change…

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

I've recently fixed filteredtree count (now the "all tasks" count is always right), but I think the count keeping could be refactored a bit.
What we count must always be equal to len(self.displayed_nodes), so we could create a derived class from dict that keeps the count.
Does anybody know if len(dict) is O(1) in python (in other words, does dict contain a updated count)?

Anyway, the "tasks with no tags" count is taken from a filtered tree. That number is wrong, so there must be something with that class.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

"Does anybody know if len(dict) is O(1)"

I'm pretty sure it is but, anyway, it doesn't matter. First, we have to get things right. Even if it involves bad performances. We will care about performances only if profiling told us that task counting is expensive.

I'm sure a len(dict) is not a problem for GTG performance. So just change the methode to use "len(dict)".

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

True.
I think it's fixed now (at least, the counts make sense with my task sets).

Changed in gtg:
status: Triaged → In Progress
assignee: nobody → Luca Invernizzi (invernizzi)
Revision history for this message
Luca Invernizzi (invernizzi) wrote :

Forgot to say, Bryce, please test this one (since you have a huge task set).
To avoid destroying your tasks, run ./scripts/import_my_tasks_into_debug_tasks.sh && ./scripts/debug.sh

Revision history for this message
Bryce Harrington (bryce) wrote :

Well, the good news is that it remains consistent from run to run, unlike before, but it is still incorrect.

Tasks with no tags shows '3' (correctly) with WorkView on, but shows '55' (incorrect, should be 5) when WorkView is off.

I notice also that 'All tasks' seems to still be slightly off. With WorkView on it shows 215 tasks whereas the titlebar shows 201 when 'All tasks' is selected. My rough count indicates 201 is probably the more correct count. With WorkView turned off, both the title and 'All tasks' shows the same count, 749, which I have no reason to think is incorrect.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Fixed in rev. 261

Fixed the incorrect "notag" count. It was only because the "active" filter was
  not applied to that filteredtree, thus counting closed notag task too.

  Question is: why were those tasks not displayed ? Is this another filter
  somewhere ? We have to remove it.

  Also remove the get_nodes_count function in filteredtree : a similar
  get_n_nodes already exists since the beginning !

Changed in gtg:
assignee: Luca Invernizzi (invernizzi) → Lionel Dricot (ploum)
status: In Progress → Fix Committed
Revision history for this message
Bryce Harrington (bryce) wrote :

I can confirm the numbers are a lot more sane now, and appear to match up to what is displayed in the list.

(However, gtg does not appear to be showing grandchildren tasks in the grandparent tags, but I think this is a separate issue, related to bug #589225).

Changed in gtg:
milestone: 0.3 → 0.2.9
Izidor Matušov (izidor)
Changed in gtg:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.