Returning Duplicates when Searching Upcoming Releases

Avatar image for bnkohrn
bnkohrn

4

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1  Edited By bnkohrn

I'm currently working on an iOS app that will let users browse upcoming releases from multiple platforms.

When searching for upcoming Xbox One releases that have an expected release year, I append those results to an array. Then, when I hit the last result on the page, if it has an expected release year, I perform another search on the next page.

So for Xbox One games, there are currently 113 results total that have an expected release year. I get the first page, 100 results, and append those to my array. I, then, perform a search on the next page of results and return 13. That all works well, but sometimes I notice that games are duplicated when there is more than 100 results (more than one page).

The way that I paginTe my results is that if the last result has an expected release year and the count of the array is 100, I then change the offset parameter to 101 to continue the search on the second page of results.

Does anyone have any idea as to why I'm returning duplicated results? It doesn't happen on every search, and when it does, the duplicates are not always the same; some queries may return 5 games that have duplicate entries, while on the next search it may be a different 7 games.