tasking-manager: [BUG] "You Mapped" Stats not adding totals correctly.

Describe the bug On the stats page for the user, you can see that the total tasks does not add up correctly:

Screenshot 2023-10-11 at 10 45 08

We can see here that 82 + 25 does not add up to 91.

We can see that the addition is handled differently between the “You Mapped” section, and the “You Validated” section. https://github.com/hotosm/tasking-manager/blob/547e0ce706d40d680c774803828ae8c6a5cebf62/frontend/src/components/userDetail/elementsMapped.js#L33 https://github.com/hotosm/tasking-manager/blob/547e0ce706d40d680c774803828ae8c6a5cebf62/frontend/src/components/userDetail/elementsMapped.js#L51

To Reproduce

  1. Go to “My Contributions”
  2. If you have mapped a fair amount, you’ll be able to view the issue - the numbers do not add up for “validated” + “needed more mapping

Expected behavior The numbers should add up correctly, or, it should be clear why the “validated stats” addition is different to the “you mapped stats” addition.

Screenshots N/A Desktop (please complete the following information): N/A - No reason why it should or may be different across different devices.

Additional context N/A - May be related to our migration to ohsome stats and that the old stats being broken? Not sure. This may also be a backend issue, rather than a stats backend issue.

About this issue

  • Original URL
  • State: open
  • Created 9 months ago
  • Reactions: 1
  • Comments: 15 (1 by maintainers)

Most upvoted comments

Also when it goes for “needed more mapping” under “You mapped” those will be probably tasks that had been marked as “More mapping needed” before I locked them for mapping (I am fixing invalidated task mapped by someone else then me).

I always thought that those 91 tasks just wasn’t validated yet 😄

That’s interesting if so - the assumption in the TM call was that there was some sort of bug, as the equivalent on the validation stats side (on the right) is an addition of the two other numbers… Hmmm… Either way, we should probably find out what this stat is haha 😅

@JoltCode - thanks so much for quickly capturing the discussion from our working group meeting. Would you be interested in working on a fix for this?

Yeah, although not sure if your team would be better at fixing this - the code for incrementing the stats is a little hard to understand… Perhaps we could discuss over Slack?