MastoAPI: Pagination of blocks and mutes is reversed
Users are unable to progress past the first page of blocks:
MastoAPI returns a Link
header for pagination (used by Soapbox FE), and Pleroma does return it:
link: <https://gleasonator.com/api/v1/blocks?limit=20&max_id=9v5brU9dKl0aMUwSHY&offset=0>; rel="next", <https://gleasonator.com/api/v1/blocks?limit=20&min_id=9v5bmblPcCBsVvHqbI&offset=0>; rel="prev"
However, the next
link gives me the same results as before minus 1 (only 19 results) while the prev
link gives me what I want, the next 20 results.
I've hotfixed this in Soapbox FE by swapping the next
and prev
links for blocks and mutes only: https://gitlab.com/soapbox-pub/soapbox-fe/-/merge_requests/460/diffs
Side note: Link header pagination seems to work fine for follows and followers. I haven't tested the other types, like domain blocks.
I have a hunch the real problem isn't the Link
header (it looks correct) but rather that the blocks/mutes queries are sorted in the wrong direction, so max_id
isn't doing what it's supposed to here.