Closed pawel-dabro closed 3 years ago
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Which SDK version are you using?
v. 7
What's the issue?
ApiNodeList.nextPage requests one additional page even when it's at the last page of results currently. Documentation in https://developers.facebook.com/docs/graph-api/using-graph-api/#paging states:
However, in that case ApiNodeList.nextPage falls back to cursor-based paging mechanism and only stops after retrieving an additional empty page with no cursor information.
Steps/Sample code to reproduce the issue
Use any graph edge that returns ApiNodeList like campaigns, that returns one or more pages of data
Observed Results:
For
N
pages of data, there isN+1
requests beign made. One final request is made when there is nonext
link, which results in a response with empty data array and no paging section. Only after that paging stops, even though it is apparent from the lack ofnext
page inN
th response thatN+1
th request is not necessary.N
th requestN+1
th requestExpected Results:
ApiNodeList.nextPage should not make the extra (
N+1
th) request for empty page when it knows from its current state that there was no more data.