~sircmpwn/git.sr.ht#280: 
[pagination] Wrong number of items on user's project list

When scrolling through ~sircmpwn projects list, I noted that there are usually 15 items per page, except for pages 4 and 5 where there are only 14 items.

Here's a screen recording : https://cloud.augendre.info/s/5Yo84tZ9oS268Ng

Status
REPORTED
Submitter
~crocmagnon
Assigned to
No-one
Submitted
2 years ago
Updated
1 year, 5 months ago
Labels
No labels applied.

~nabijaczleweli 1 year, 9 months ago

I can reproduce this right now with pages 5 and 6 out of 9, for which document.getElementsByClassName("event").length returns 14 instead of 15.

However I cannot reproduce this with the API, which returns two sets of 50 results, then 15 (making the repository count 115, 123, or 121, but take my API numbers with a grain for salt).

This is very very interesting, since the final query is in the form of

SELECT repository.id, ...
FROM repository
WHERE repository.owner_id = 1 AND repository.visibility = 'public' ORDER BY repository.updated DESC
 LIMIT 15 OFFSET 30;

and no matter what I did to any test data I could not get it to return less than 15 results, except at the end.

Similarly, the user.html template in scm.sr.ht doesn't filter the repositories further, so I can't really see a place for this to happen in? I'm at a loss.

Register here or Log in to comment, or comment via email.