HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

"Wrong" comment count after discussion deletion - bug or feature?

R_JR_J Ex-FanboyMunich Admin

By now the comment count of a user isn't updated when a discussion is deleted where he commented on. It has been reported as a bug on GitHub and I've tried my hands on a solution. @Linc had a very busy day yesterday reviewing a lot of pull requests, and that was one of them. It has been rejected, last but not least ;), because of performance considerations.

So before I thought about alternative solutions, I had a second thought about the problem itself. User A has written x comments, y were deleted and z comments remain. So if I look at user A's profile, what would I expect to see:

a) the number of comments that I can find when I look at /profile/comments/... (z) or
b) the number of comments a user has written (x)?

Hard to tell. If user A made 10 comments and I can only see 7, I would be clearly speaking of a bug - but only at first sight.

Look at the whole procedure for example here on vf.org: if user A made 10 comments, he gets a shiny badge! And why does he get it? Because he deserved it, defined by the rules for that badge. He has written 10 comments, and it doesn't count how many of his comments has been lost in a deleted discussion. He has deserved that badge. So nobody would want to remove that badge from him!
Okay, now if we look at user A's profile we see a comment count of 10 comments, a 10 comments badge and that's a fit: he definitely has written 10 comments and that's a true statement.

But what if we look at the list of comments? It shows only 7 comments, although user has written 10 comments. But if we agree on the fact that the 10 comments is somehow also a correct information which has to be kept so that actions depending on the 10th comment still make sense, we maybe don't have to think about the binary "show this or that number" decision. Maybe we have to provide additional information in order to get a consistent picture?

As I've said before, I had a second thought about the problem itself and to me now the best "solution" for this is to add the information "y deleted comments" to /profile/comments/... where "y" is simply users CountComments - pagers TotalRecords.


  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Some additional thoughts:

    I do not have an idea on how to present that information best and that would be my first shot


    (3 deleted)

    But on the other hand I think this information is of minor importance and so it could also be below the pager, but information below the pager looks like it isn't related to the content so I wouldn't put it there. I'm no UI/UX guy... :-(

    Because of the minor importance, it might be a consideration to drop that information in order not to raise any questions on user side. If they find the inconsistency it could still be explained with deleted comments.

    If there is any action concerning the original issue, it should be reflected in the discussion count, too. By now the behavior of discussion count and comment count in relation to deleted discussions is different, and that's IMO the only issue by now.

  • Options
    LincLinc Detroit Admin

    FYI: We simply don't revoke badges, so it's not that we still consider him to have written 10, it's just that if it triggered, it triggered. n that example where 3 of 10 were deleted, the 20 comment badge shouldn't trigger until he's made 13 more comments. The same math applies to Reaction-based badges.

Sign In or Register to comment.