The most liked topic of any discourse

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