I noticed sometimes the number of likes are not equal with the user avatars who liked the post. This is happening when the user who liked the post has been deleted. Is this for statistic reason or a bug?
Probably related to a user being deleted from the system. I am guessing we may not be forcing a refresh of the post like count on posts that a deleted user voted on.
I think you can trivially cause a re-sync on the post count if you like / unlike the post. Looks like the issue in the OP is now resolved due to a like/unlike sequence.
When a user is deleted from the community, their likes are deleted too. For posts that they previously liked, when we now view the avatars of people who have liked the post, the deleted user’s avatar is removed as expected.
Problem:
However the like count itself is still not updated after the user has been deleted.
So there might be a like count of 4 on a post, but there are only 3 avatars showing. This can be confusing.
For posts that they previously liked, view the like count and avatars of who liked the post
Expected:
The deleted user’s avatar has been removed, and the like count has decreased by 1 on the posts
Actual:
The deleted user’s avatar has been removed, but the like count is still the same on the posts.
Extra notes
Thanks to one of our users for noticing this issue – I just decided to make a report here. Please let me know if you need more information to confirm.
I’m not sure what would be ideal for expected/actual behaviour. If the like count is decreased by 1, I don’t know how it would affect badges, etc.
But considering that it currently already deletes the avatar, having the like count remain the same is confusing. I was initially expecting to view an avatar with a trash can icon perhaps, to replace the deleted user. (I think it might have been that way in earlier versions of Discourse but maybe I’m misremembering for deleted posts)