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

SearchService#searchPostByUrl breaks if the number of Posts is less than a full page #424

Closed
alter-kaker opened this issue Jun 20, 2024 · 2 comments · Fixed by #435
Closed
Assignees
Labels
bug Something isn't working

Comments

@alter-kaker
Copy link

This method fails with a IndexOutOfBoundsException if the number of posts returned in the CrossPost.posts field is less than needed to fill the current requested page.

For example:

  • 0 Post objects returned for page=0, pageSize=1
  • 1 Post objects returned for page=0, pageSize=2
  • 3 Post objects returned for page=1, pageSize=2
  • 4 Post objects returned for page=2, pageSize=4
@alter-kaker
Copy link
Author

See disabled tests in #423

@kgilles kgilles moved this to 🔖 Ready in Sublinks Development Jun 24, 2024
@kgilles kgilles added the bug Something isn't working label Jun 24, 2024
@Pdzly
Copy link
Member

Pdzly commented Jun 24, 2024

The issue on hand here is that we expect a page range from 1-open end. I will fix it by clamping that value in the service.

And add some java doc to there when i am already there

This should be the same issue with the other functions too.
Because there should not be a 0 acceptable from the api and thus this issue never occured.

@Pdzly Pdzly self-assigned this Jun 24, 2024
@Pdzly Pdzly moved this from 🔖 Ready to 🏗 In progress in Sublinks Development Jun 24, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Sublinks Development Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants