sublinks / sublinks-api

MIT License
68 stars 17 forks source link

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

Open alter-kaker opened 1 week ago

alter-kaker commented 1 week ago

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:

alter-kaker commented 1 week ago

See disabled tests in https://github.com/sublinks/sublinks-api/pull/423

Pdzly commented 5 days ago

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.