Reply sorting broken with in a Top date range

AI-generated summary

The discussion addresses a bug where reply sorting is broken when using the “Top” date range filter in Discourse. John_Brock reports that after selecting a date range, the “Replies” column can no longer be sorted in reverse order to prioritize topics with zero replies. simon confirms the issue, noting inconsistent behavior in Chrome on Linux, where clicking the “Replies” header incorrectly appends ?ascending=false without changing the order. sam identifies the problem occurs on filtered lists (e.g., /c/bug/1/l/top) but not on the main /top page. blake provides good news, stating the issue has been fixed in a recent commit and is already live on Meta, with the fix expected to roll out to other sites in the next week.

I’m trying to clean up old messages that have not been replied to in our Discourse categories..
I find that when I choose the “Top” tool to select a date range, then I can no longer reverse sort by Replies.
I want to get the 0 reply messages to the top of the list and avoid manually scrolling down multiple pages to get to them.

Thanks

2 Likes

I’m getting inconsistent results when I test this on Meta. What I expect to happen the first time I click the “Replies” table header is for the query parameter ?ascending=true&order=posts to be appended to the URL that’s in my browser’s address bar. The second time the “Replies” table header is clicked, the query parameter should be updated to ?order=posts.

The behaviour I’m finding is that clicking the “Replies” header is appending the ?ascending=false query parameter. This has no effect on the order of topics in the list. Clicking the “Replies” header a second time removes the ?ascending=false query parameter. This also has no effect on the order of the topics.

If I manually append ?ascending=true&order=posts to the URL in my browser’s address bar, clicking the “Replies” header works as expected.

I am finding this behaviour on the Top list, but also sometimes on the Latest lists. I am not sure why the results of clicking the “Replies” header are inconsistent. Once I have added the
?ascending=true&order=posts query parameter to a URL, the “Replies” filter seems to work correctly on subsequent pages that I visit.

I’m running the Chrome browser on Linux.

3 Likes

That’s the problem.
I’m running Chrome under Windows 10 (1909) and MacOS Catalina 10.15.4

Yeah we definitely have a bug here …

  1. Works totally fine at https://meta.discourse.org/top (click replies sorts by replies)

  2. Does not work as expected at https://meta.discourse.org/c/bug/1/l/top

@zogstrip / @eviltrout can you assign out?

2 Likes

@John_Brock Good news! We have a fix for this now.

https://github.com/discourse/discourse/commit/d27b877a40333cc6bc94984016071b5660da7f0f

It has been applied here on meta, and will arrive on your site whenever we do the next deploy of your site (probably in the next week or so).

7 Likes