I understand your concern and frustration. It's my fault for not documenting this properly. hasNextPage is not exhaustive but rather a hint that sometimes provides false positives. hasPreviousPage should work correctly. But for hasNextPage to always return the correct result we would have to retrieve the count of (filtered) rows from the backend which we don't do currently. So if you ask for N records but get < N, then it will properly tell you that there is no next page. But if you get exactly N, it will say there is a next page. However, fetching for the next page should return an empty set. I understand that is a request too many that incurs costs, but it shouldn't generate an infinite loop (like you seemed to suggest). We will investigate how to improve this.
... View more