fauna / faunadb-js

Javascript driver for Fauna v4 (deprecated)
https://docs.fauna.com/fauna/v4/
Other
702 stars 76 forks source link

PageHelper.nextPage() fails to handle the final page #679

Open wallslide opened 1 year ago

wallslide commented 1 year ago

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.

github-actions[bot] commented 1 year ago

Internal ticket number is FE-3288

wallslide commented 1 year ago

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