addons-frontend icon indicating copy to clipboard operation
addons-frontend copied to clipboard

Use the `page_count` returned from the API response to determine the maximum number of pages for pagination links

Open bobsilverberg opened this issue 3 years ago • 5 comments

This was discovered during the investigation of https://github.com/mozilla/addons-server/issues/17362.

According to @diox:

"We have configured Elasticsearch in a way that doesn't allow pagination to go past 25000 items (1000 pages of 25). The search API returns a 404 on purpose here."

Therefore, we should not base the maximum number of pages that we use for pagination links on a calculation, but rather we should use page_count which is returned to us in the API response.

bobsilverberg avatar Jun 16 '21 12:06 bobsilverberg

We had an issue opened for this since the beginning of the new frontend, but we never got to fixing it :) - https://github.com/mozilla/addons-frontend/issues/3887

AlexandraMoga avatar Jun 16 '21 13:06 AlexandraMoga

Wow, yeah, that's an old issue! Thanks @AlexandraMoga!

bobsilverberg avatar Jun 16 '21 13:06 bobsilverberg

Given that there is an API field returning the page count, I think the frontend should use that. We should probably close this and re-open the old one...

diox avatar Jun 21 '21 13:06 diox

Reading through the old issues, I'm not sure it makes sense to re-open any of them, as they are somewhat confusing. Let's just rename this one to have it be about using page_count.

bobsilverberg avatar Jun 21 '21 18:06 bobsilverberg

This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.

stale[bot] avatar Jul 31 '22 10:07 stale[bot]