Limit the amount of entries displayed in a directory to 1000
Summary
Currently the way we implemented the paging ("Show more") on the FE is not taking into account that trees, submodules, and blobs in the GraphQL response for entries can each contain up to 100 entries.
So that means a single response can have up to 300 entries, and the way we determine when to stop fetching and show more is by checking how many times we've requested entries (fetchCounter < 10), which might not be the best way to do this because we can end up with up to 3000 (10*300) per page.
Steps to reproduce
- Open https://gitlab.com/fdroid/fdroiddata/-/tree/master/metadata
- Notice more than 1000 entries are loaded.
Example Project
https://gitlab.com/fdroid/fdroiddata/-/tree/master/metadata
What is the current bug behavior?
More than 1000 entries are loaded.
What is the expected correct behavior?
Limit to 1000 entries per page.
Relevant logs and/or screenshots
Possible fixes
The way we determine when to stop fetching and show more is by checking how many times we've requested entries (fetchCounter < 10), which might not be the best way to do this because we can end up with up to 3000 (10*300) per page.
We could instead rather check against the total number of entries to determine when to stop fetching and diplay the "Show more" button.
