Affected people from duplicates aren't included in the master bug's affected count

Bug #678090 reported by Fabio Marconi
44
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Martin Pool

Bug Description

Hello
If I mark a bug as duplicate of another the number of affected poeple is not updated, so if I have a report with 10 persons afflicted and I mark it as a duplicate of a bug with only 2 person afflicted, the result is that bug afflict only 2 persons instead 12.
Example, https://bugs.launchpad.net/ubuntu/+source/linux/+bug/638791 , has 3 persons afflicted and 17 duplicates.
Thanks
Fabio

Related branches

summary: - Number of affacted people not updated
+ Number of affected people not updated
Revision history for this message
Graham Binns (gmb) wrote :

Given that the number of subscribers from duplicates is taken into account when bug heat is calculated it seems odd that we don't update the subscriber count on the page, too.

summary: - Number of affected people not updated
+ Affected people from duplicates aren't included in the master bug's
+ affected count
Changed in malone:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Robert Collins (lifeless) wrote :

This looks like we show the wrong attribute (users_affected, not users_affected_count_with_dupes) in templates - so a shallow thing to change /code wise/ - but it will need some performance checks to make sure it doesn't regress anything.

Revision history for this message
Robert Collins (lifeless) wrote :

The thing to change is in lib/lp/bugs/browser/bugtask.py.

Martin Pool (mbp)
tags: added: affectsmetoo
Revision history for this message
Martin Pool (mbp) wrote :

This is a special case of bug 343110, but perhaps easy to fix separately.

> This looks like we show the wrong attribute (users_affected, not users_affected_count_with_dupes) in templates - so a shallow thing to change /code wise/

I looked at this in the code, and there is indeed a possible snag. users_affected_count is stored on in a column on the bug, but users_affected_count_with_dupes is calculated by finding all the users and counting them, so there's at least a possible performance problem there. We can either see if it is fast enough to query it, or we could add another cache in the database.

Adding them up, whether done at update time or query time, ought to take into account that if person A is affected by bugs X and Y that end up both being marked as dupes of Z, that's only one person.

Revision history for this message
Martin Pool (mbp) wrote :

... if we later want to sort by total affected users, across all dupes, and it seems to me we would, then that may only be feasible to do if it's stored in the bug table.

Martin Pool (mbp)
Changed in launchpad:
assignee: nobody → Martin Pool (mbp)
status: Triaged → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 678090] Re: Affected people from duplicates aren't included in the master bug's affected count

The count is higher on qas and it's not timing out.

  tags qa-ok -qa-needstesting

Martin Pool (mbp)
tags: added: qa-ok
removed: qa-needstesting
Steve Kowalik (stevenk)
Changed in launchpad:
status: Fix Committed → Fix Released
Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Ok, thanks guys.
Fabio

Revision history for this message
Shahar Or (mightyiam) wrote :

Dear Friends,

While it may be that the the affected counter rises, it still says "does it affect you too?".

So I was thinking for a long time, even after the date when this fix was released that this isn't fixed yet.

So... Is it really fixed :) ?

No, really, I trust what you say- that it is fixed - but what about the UI? Shouldn't the fact the it counts my "affect" from the duplicate be expressed in the UI as "This bug affects you and X more people"?

Thanks and Blessings,
Shahar

Revision history for this message
Martin Pool (mbp) wrote :

@Shahar, there's an edge case here:

bug X is a dupe of bug Y
they have independent lists of affected users
so if they're un-duped or re-duped, you can still see who was affected by each of them
but, we show the total count on Y

So there is a slightly confusing, but logical, case where you are included in the count on Y but you can also say whether it includes you or not. Being affected by the master, if you're affected by a dupe, won't increase the master's total count, but it will affect what happens if they're ever un-duped.

The ui could be improved but I don't think it's important.

Revision history for this message
Shahar Or (mightyiam) wrote :

Dear Martin,

Thank you for the clarification. I wasn't sure, really.

I, for one, was confused, thinking that I should mark the master as affecting me.

So I reported as Bug #973228.

Thanks and Blessings,
Shahar

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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