You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, post reports, comment reports, and registration applications sort by publication date in descending order by default and in ascending order when unresolved_only is true, while private message reports are always returned in descending order by publication date of the message itself. This renders it impossible to display a sorted feed of all unresolved reports.
Describe the solution you'd like.
I propose adding an ascending/descending sort_order parameter to the API endpoint that, if present, overrides the default sorting behavior with the specified ordering.
Describe alternatives you've considered.
Sort client-side: possible for the first page, but sorting issues emerge on later pages. Re-sorting every page fetch is infeasible as new items will be inserted at the top of the feed, out of the user's sight.
Fetch all (or a large number of) items and filter client-side: slow and bad API citizenship
Additional context
No response
The text was updated successfully, but these errors were encountered:
while private message reports are always returned in descending order by publication date of the message itself.
That seems to be the main bug here. The sorting logic in the code is:
If viewing all reports, order by newest, but if viewing unresolved only, show the oldest first (FIFO)
I don't know if we'd want to complicate that logic by moving it client side. Probably best to not have a sort parameter, and let the back end apply the above rule.
Combining these types and properly sorting them is limited by #2444 . Because rn they could have wildly different time ranges.
Requirements
Is your proposal related to a problem?
Currently, post reports, comment reports, and registration applications sort by publication date in descending order by default and in ascending order when
unresolved_only
istrue
, while private message reports are always returned in descending order by publication date of the message itself. This renders it impossible to display a sorted feed of all unresolved reports.Describe the solution you'd like.
I propose adding an ascending/descending
sort_order
parameter to the API endpoint that, if present, overrides the default sorting behavior with the specified ordering.Describe alternatives you've considered.
Additional context
No response
The text was updated successfully, but these errors were encountered: