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
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:
What happened? This could be a description, log output, etc.
For N pages of data, there is N+1 requests beign made. One final request is made when there is no next 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 of next page in Nth response that N+1th request is not necessary.
Nth request
2020-09-21 13:06:33.743 ========Start of API Call========
2020-09-21 13:06:33.743 Request:
2020-09-21 13:06:33.743 GET: https://graph.facebook.com/v7.0/act_.../campaigns?acce
ss_token=...&fields=id%2Cname&limit=25&after=QVFIUkhyNWtiM1JJLTk5WEhRaWZAFc0F...&appsecret_proof=...
2020-09-21 13:06:33.831 Response:
2020-09-21 13:06:33.831 {"data":[
<LAST PAGE OF DATA RETURNED HERE>
],"paging":{"cursors":{"before":"QVFIUkVES3hiV0tyUjQ...","after":"QVFIUlJReDdpSDlOcHlGeUYzemhqNDRsYV..."},
"previous":"https:\/\/graph.facebook.com\/v7.0\/act_...\/campaigns?access_token=...&fields=id\u00252Cname&limit=25&before=QVFIUkVES3hi..."}}
2020-09-21 13:06:33.831 ========End of API Call========
N+1th request
2020-09-21 13:06:33.836 ========Start of API Call========
2020-09-21 13:06:33.837 Request:
2020-09-21 13:06:33.837 GET: https://graph.facebook.com/v7.0/act_.../campaigns?acce
ss_token=...&appsecret_proof=...&after=QVFIUlJReDdpSDlOcHlGeUYzemhqNDRsYV...&fields=id%2Cname
2020-09-21 13:06:33.887 Response:
2020-09-21 13:06:33.887 {"data":[]}
2020-09-21 13:06:33.887 ========End of API Call========
Expected Results:
What did you expect to happen?
ApiNodeList.nextPage should not make the extra (N+1th) request for empty page when it knows from its current state that there was no more data.
The text was updated successfully, but these errors were encountered:
pawel-dabro
pushed a commit
to codewise/facebook-java-business-sdk
that referenced
this issue
Sep 21, 2020
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.The text was updated successfully, but these errors were encountered: