bminer/node-twilio-api — pull request #14 by singlow (2013-02-21 22:24:41+00:00)
Title: Do not double-call prevPage and nextPage callback

When I use ListIterator.nextPage and pass in a callback, it is passing the callback to the load function, which will call the callback async, and then the nextPage function calls the callback itself, synchronously. This second call will actually contain the Results from the first page, since load has not yet run. prevPage looks like it does the same thing.

I built my code to recursively call nextPage until it is done to download an entire list, however the result is that a 10 page list results in my callback getting called 10 + 9 + 8 + 7... times. Is there another way this is supposed to be used?

This Gist has a sample of how I am trying to use it:
https://gist.github.com/singlow/5008826

Additionally, right now Twilios paging parameters seem to be non-functional so it is pointless to really test it. Their support team said they are working on that.