Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and improve page number validation for following/followers pages #9361

Merged

Conversation

pidgezero-one
Copy link
Contributor

Closes #9283 (cont'd)

  • Fixes page validation for followers/following pages in the event that the page ID is already an integer and not a string
  • Defaults to the last valid page if the provided page is too high

Technical

  • I extracted page validation into an "unexported" function for cleanliness. It covers the page qparam being either an int or a string as well as a fallback to just return 1.
  • I noticed I had no checks for invalid pages that are too highly numbered, so I added that as well.

Testing

I repeated my tests from #9323, but also tried loading the page with invalid high values like 21, 100, etc.

Screenshot

There was no change in the results of my tests from #9323.

Here is another screenshot with a page number that is too high:
image

Stakeholders

@mekarpeles

Attribution Disclaimer: By proposing this pull request, I affirm to have made a best-effort and exercised my discretion to make sure relevant sections of this code which substantially leverage code suggestions, code generation, or code snippets from sources (e.g. Stack Overflow, GitHub) have been annotated with basic attribution so reviewers & contributors may have confidence and access to the correct context to evaluate and use this code.

@github-actions github-actions bot added the Priority: 2 Important, as time permits. [managed] label May 29, 2024
@mekarpeles mekarpeles merged commit fcdbacf into internetarchive:master May 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 2 Important, as time permits. [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paginate Followers & Following pages
2 participants