joshfng/macromode-android — Issue #17: Infinite paging when results run out
Author: joshfng
Created: 2012-02-17 02:19:18+00:00
State: open
Labels: Bug

I found a bug in the pager system being used. Once all the pages are exhausted (ie I keep scrolling down until there's nothing left) the pager starts infinitely pinging the api with an ever increasing page= param. It slammed the server with thousands of requests per minute in a never ending loop.

I'm assuming this is a bug in the logic where if it figures out how many images are visible it should request another page, yet because no results came back it just keeps requesting the same page.

I think im my initial version I solved this by creating a should_page variable. When the bottom was hit and requested a page that came back with 0 results I set should_page to false. Then in the pager code I only called for the next page if should_page was true.