You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running response.hasNextPage(), under the hood the CursorPagination class is referencing this.result_info?.cursor when the data is set within the CursorPagination class under this.result_info.cursors. This can be seen below:
To Reproduce
Install cloudflare at version 4.2.0.
Request to list all list items with client.rules.lists.items.list where client is an instance of Cloudflare.
Set page size to less than total list size.
Attempt to call response.hasNextPage() and response.getNextPage() with expected functionality to paginate through results.
Unexpectedly skip pages of results.
Code snippets
After further testing, the public iterPages method also produces the same result, because of the same issue:
// this will only result in one iteration, when it should result in moreforawait(constpageofresponse.iterPages()){constitems=page.getPaginatedItems();}
I have also tested the following change is in the code above is a successful work around. The only odd (likely expected) issue I have run into with this is that the per_page needs to be the same when paginating or else you'll run into an error. And per_page also seems to be required to be <= 500.
Uh oh!
There was an error while loading. Please reload this page.
Confirm this is a Typescript library issue and not an underlying Cloudflare API issue
Describe the bug
I am attempting to paginate all pages of my list items in cloudflare:
When running
response.hasNextPage()
, under the hood theCursorPagination
class is referencingthis.result_info?.cursor
when the data is set within theCursorPagination
class underthis.result_info.cursors
. This can be seen below:To Reproduce
4.2.0
.client.rules.lists.items.list
whereclient
is an instance ofCloudflare
.response.hasNextPage()
andresponse.getNextPage()
with expected functionality to paginate through results.Code snippets
After further testing, the public
iterPages
method also produces the same result, because of the same issue:I have also tested the following change is in the code above is a successful work around. The only odd (likely expected) issue I have run into with this is that the
per_page
needs to be the same when paginating or else you'll run into an error. Andper_page
also seems to be required to be <= 500.OS
macOS
Runtime version
Typescript 5.6.2
Library version
v4.2.0
The text was updated successfully, but these errors were encountered: