Sort order is inconsistent on "load more" on group page

סיכום מבוסס בינה מלאכותית

Moin reported an inconsistency in the sort order when using the “load more” feature on group member pages. By visiting the user-testers group sorted by “Added” (descending), the initial list of 50 members displays correctly. However, upon loading additional members, Moin observed a gap in the sorting sequence, causing some users to appear twice while others were missing entirely.

southpaw confirmed the issue by inspecting the network requests. While the initial request for order=added_at correctly passed an empty asc parameter (implying descending order), the subsequent “load more” request automatically changed asc to true. This switch in sort direction between the initial load and the paginated results causes the overlapping and missing user data.

Steps to reproduce:

  1. Open https://meta.discourse.org/g/user-testers?order=last_seen_at&asc=false
    You should see the group members who visited Meta recently first. :check_mark:
  2. Now click “Added” and you see the members who were added recently. This is fine. The sort direction hasn’t changed.
  3. Scroll down to load more than the first 50 members. Right where the members were loaded later, there is a gap in the dates:
  4. Scroll further and notice the users you have already seen at the top.

I would expect the sort order to be consistent on “load more”, so I see all members instead of some twice and others not at all.

3 לייקים

Thanks for the report, @Moin
I’m not equipped to fix this, but I’ll just add what I see in the console.

When I click the Added column header, the console reports:
https://meta.discourse.org/groups/user-testers/members.json?offset=0&order=added_at&asc=&filter=

When I reach the load-more point this asc value becomes true:
https://meta.discourse.org/groups/user-testers/members.json?offset=50&order=added_at&asc=true&filter=

3 לייקים