Post keeps the number of likes after who liked the post, has been deleted

Description

Context:

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.

Screenshot I have edited from one of our users:

Steps to Reproduce

  1. Have a user like a number of other posts
  2. Delete the user
  3. 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)

2 Likes