Private likes count shown in public profile


#1

I know that, in the past, “total likes count” used to be equal to “public likes+private likes”.

In my old discourse sites, there are a lot of users with 1k+ “as their likes count” - which includes “public+private likes”.

But, in a newly installed Discourse instance, I noticed that, “Private likes are no more counted in “total likes count” shown in public profiles”

My question - Is there any way to fix the “likes count” in my old discourse site?


#2

Bump.

I’m sure there is going to be lots of users, with Discourse sites, in which the “likes count” needs to be fixed.


(Sam Saffron) #3

this is by design, exposing private information in the counts was a bug.


#4

@sam
Is there a way we can fix the “likes-count” now that the bug has been fixed.


(Sam Saffron) #5

As in to revert the fix and break the fix we deployed.

No there is no way to do that.


#6

@sam
I didn’t quite get you there.

If I’m understanding things correctly:

Now that the bug has been fixed, likes-count = “count of likes received publicly”

Previously, likes-count “was” = “count of likes received publicly + through PM”

So, for new users, everything looks good. But for existing users, “likes-count” is wrong.

So, now that the bug has been fixed, is there any way, we can initiate a “re-counting of likes” and then make it display the right count? I have read in other threads about commands that fix the “posts-count”, “topics-count” etc. Is there such a command that we can issue for fixing the “likes-count”


(Sam Saffron) #7

There is possibly a rake task for this, will have a look tomorrow.


(Felix Freiberger) #9

Just as here: Is this something that should occasionally be recomputed on every instance to make sure this data is consistent? I’d like to see that.


(Sam Saffron) #10

There is already a query for this that runs daily, trouble is that it was broken.

I fixed it per: FIX: stop counting PMs, deleted topics and whispers in directory and … · discourse/discourse@7e841a0 · GitHub

After applying this fix @nixie you must wait at least 24 hours for the directory to be re-calculated and it should automatically fix the existing bad counts.


(Jeff Atwood) #11

Thanks for following up on this @nixie we fixed a long standing bug :beers:


#12

@sam
Will it work “even if the user directory is disabled in the site” ?


(Sam Saffron) #13

No it will now, directory must be enabled for the fix to work.

It will fix likes given and received counts.


#14

@sam
I’m thinking of enabling the user-directory “just for 1 day” to fix the "old counts"
And once the “old counts” are fixed, I will disable the “user-directory”.
This is my plan.

Or do you think, I should “enable the user-directory” forever to ensure that the counts don’t go off again?


(Sam Saffron) #15

I would recommend this, not sure why you want to disable it.


#16

I have never tried it before, so was thinking twice before enabling it forever.
I made up my mind - I’m going to enable in my site. :slight_smile:


(Jeff Atwood) #17

This topic was automatically closed after 19 hours. New replies are no longer allowed.