Likes Count Inconsistently Low for Topics


#1

We have started noticing that topics in our forum are displaying incorrect Likes counts. This is occurring both in the main Topics list, and also in the summary at the top of the topics. These incorrect counts are not even consistent, varying from 1 to 8 for different users, and even changing on page refresh. So far, we have confirmed that 4 topics are definitely affected, though there may be more. Here is an screen cap from the topics page:

And a screen cap from an affected topic:

The affected topic in the screen shot has 4 total likes as of the time of this posting.


#2

I have been able to determine how additional topics are affected by this:

  1. Find an unaffected topic:
  2. Like a post in that topic.
  3. The topic is now affected by the incorrect like count bug.

#3

I think I could just repro on meta.discourse.org. This topic showed some 335 likes in the topic list, after I liked the last post in the topic it is down to 5.


#4

And it’s even affected this topic here!


#5

Could repro with another topic. Some 35 likes, after I liked the last post, down to 1. Unliked the post, and in the topic list the topic doesn’t show any likes.


#6

Confirmed, during my initial efforts to repro, unliking does not correct the problem for the affected topic. I assume it’s related to the way that you can’t unlike a post to like another one when you are up against the daily limit.


(Régis Hanol) #7

When did you start noticing this? A couple of hours ago? Today? A week ago?


#8

Today. Within the last hour, I think. Definitely appeared no more than 2 hours ago.


(Régis Hanol) #9

Ok, might be my fault. Looking at it.


(PJH) #10

Within the last 19 or so commits is my guess @zogstrip.


#11

We were getting 500s when trying to Like stuff at roughly 1850UTC, I believe. A few minutes later we could Like again, but the counters were wrong.


(PJH) #12

I updated from f7c7d38 to bddffa7 on TDWTF then the problem appears to have started soon after.


(Régis Hanol) #13

That was indeed my fault… This is now fixed though :wink:

https://github.com/discourse/discourse/commit/57fef6864d63adaddfc61483fe6c4d88be1ed6bc

Note: if you want to restore your like counts, simply like and unlike a post on the topic. If you need it, I can build a rake task to force an update on all the topics.


#14

@PJH has updated our instance. Like counts are returning to normal now. I’ll leave a decision regarding the rake up to our admins.

Thanks for your help.


(PJH) #15

As I said over there, I don’t think that too many topics were affected, and of those that are, they’ll sort themselves out naturally. I’m not too particular about requiring a rake task.

Not speaking for anyone else who may be affected by this however…


(Sam Saffron) #16