community-platform icon indicating copy to clipboard operation
community-platform copied to clipboard

[bug] total how-to counts on user profile page are inaccurate

Open iSCJT opened this issue 1 year ago • 2 comments

Describe the bug The how-to count on user profile page does not accurately reflect the number of how-to's a user has created.

To Reproduce Steps to reproduce the behaviour:

  1. Go to community.preciousplastic.com
  2. View precious-plastic user profile and note count of 11 for how-to's
  3. Go to how-to listing and count items by precious-plastic user
  4. See there are more than 11

Expected behaviour How-to count on user profile page needs to accurately reflect the number of how-to's (same should also be the case for research items).

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Individual how-to's are only added to the user stats count if they are created or updated, this means if the count gets out of sync it will stay out of sync unless that how-to is updated again. Either a function should be run to update all counts and then the situation monitored to see if they get out of sync again or the process should be changed. Personally I would lean towards changing this to an aggregation and having a more robust mechanism that recalculates the count for the user at more regular intervals either by a scheduled job or database trigger.

iSCJT avatar May 24 '23 16:05 iSCJT

Related to this one https://github.com/ONEARMY/community-platform/issues/2277

davehakkens avatar May 24 '23 17:05 davehakkens

This might be another case of the aggregations not working as intended?

AlfonsoGhislieri avatar May 25 '23 11:05 AlfonsoGhislieri

Fixed as part of #2428

iSCJT avatar Jun 22 '23 14:06 iSCJT