faunadb-js
faunadb-js copied to clipboard
PageHelper.nextPage() fails to handle the final page
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.
Internal ticket number is FE-3288
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