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

Hello,

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?

Thanks :slightly_smiling_face:

You can check the first image’s post here…

Screenshot 2022-02-05 at 13.55.47

Screenshot 2022-02-05 at 13.56.21

3 Likes

@Don I think its the way it should be

Does look like we have an out-of-sync cache.

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.

Putting a #pr-welcome on this for now.

2 Likes

Would deleting those likes also affect the number of likes obtained toward the poster’s like count for badges?

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.

1 Like

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
2 Likes

Ah thanks for the link – I didn’t see it in the “Your topic is similar to…” popup.

This topic can be merged there or removed.

1 Like

I’ve slipped it across as multiple reports can be useful. :+1:

3 Likes