The most liked topic of any discourse

Hello guys I just want to know if any topic have got more like than this one (541likes) every discourse
(By the way it’s a nice flight simulator :slight_smile: )

3 Likes

I don’t know if there is any other topic more liked, maybe…, but that is up there for sure

5 Likes

I am talking whatever the discourse forum

I wonder if this might be a good edge case for the likes UX … seems to hang my browser trying to display when expanding. :slight_smile:

4 Likes

Yeah we should cap this at some reasonable number and display “and xxx more” @tgxworld

9 Likes

Sure, this is super rare I am putting a pr-welcome on it

It is a bit of a self-ddos.

There is a PR for this here

I am kind of kicking myself pretty hard :kick_scooter: for not explaining what the pr welcome is and what we should do.

At 150, this is a non issue:

Avatars are all cached on the CDN, 150 requests to the CDN is no huge drama, we do that for emoji with a higher number if you scroll through emojis.

So where do we draw the line and how do we draw it?

I guess if there are more than 200 avatars just have the serializer return the 200 avatars and an extra param for total. Then the actual JS code does not need any extra magic.

At the moment:

https://meta.discourse.org/post_action_users.json?id=1&post_action_type_id=2

returns:

{"post_action_users":[{"id":830,"username":"Ray","avatar_template":"https://avatars.discourse.org/v3/letter/r/e9a140/{size}.png","post_url":null,"username_lower":"ray"},...

I would like to see that controller amended to include, page and limit, then have a default setting of 200 per page and add a total: ... to the json payload so you can tell you only have a partial set.

Really this is such a complicated an involved set of changes for a problem that does not even exist.

6 Likes

Hi @sam

Thanks for the response. I’ll take another shot at this over the weekend and I’ll try to implement it following the way you described here.

One question: the controller that we need to touch also handles requests for other types of post actions such as flags, bookmarks etc. Should those be paginated too? I’d say yes (and that’s what I’m going to do unless you guys oppose it) because: a) consistency for developers working with the API to get likes, flags etc of a post, and b) less logic and code in core to maintain.

It’s a very rare edge case, yes, but don’t we have pr-welcome to cover rare stuff like this? :wink:

4 Likes

Alright… here is round 2:

https://github.com/discourse/discourse/pull/5237

1 Like