The most liked topic of any discourse


(GRX) #1

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: )


(Sam Saffron) #2

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


(GRX) #3

I am talking whatever the discourse forum


(Michael Downey) #4

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:


(Jeff Atwood) #5

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


(Sam Saffron) #7

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


(Jeff Atwood) #8

It is a bit of a self-ddos.


(Sam Saffron) #10

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.


#11

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:


#12

Alright… here is round 2: