faunadb-js icon indicating copy to clipboard operation
faunadb-js copied to clipboard

PageHelper.nextPage() fails to handle the final page

Open wallslide opened this issue 1 year ago • 2 comments

When using PageHelper.nextPage() (code here), the final page isn't handled correctly. Internally, the helper fails to mutate its state if the after cursor is undefined. This means nextPage() endlessly repeats querying and returning the final page rather than indicating that there are no more pages left.

wallslide avatar Mar 23 '23 00:03 wallslide

Internal ticket number is FE-3288

github-actions[bot] avatar Mar 23 '23 00:03 github-actions[bot]

Possibly relevant detail. This behavior was happening when all the data fit into a single page. I wasn't able to test if data that spanned multiple pages works because of https://github.com/fauna/faunadb-js/issues/680

wallslide avatar Mar 23 '23 16:03 wallslide