Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection hasNext() method returns false even if there is a next page available. #1059

Closed
ciprian197 opened this issue Feb 15, 2020 · 2 comments
Assignees
Milestone

Comments

@ciprian197
Copy link

Version 3.2.0.

When paginating data using limit=1 the before and after cursors have the same value, but in this case this doesn't mean that there is no next page available.

@nbartels
Copy link
Contributor

Can you please provide the json? It would be much easier to write a unit test and fix the problem afterwards.

@nbartels nbartels self-assigned this Feb 15, 2020
@ciprian197
Copy link
Author

ciprian197 commented Feb 17, 2020

Endpoint: me/friends?limit=1

  "data": [
    {
      "name": "John Doe",
      "id": "randomId"
    }
  ],
  "paging": {
    "cursors": {
      "before": "QVFIUlNEN1BWay1jWVVfN05JSUt2Ri1FVEJ5dXBYa2dBTVNlb2N6UDlxbDlSNXMxLUJIekVtVEd3TmhGQ2tKOXhRU3lfTTZAxNnAxMHJfME4xWlMyRHZAtekZAR",
      "after": "QVFIUlNEN1BWay1jWVVfN05JSUt2Ri1FVEJ5dXBYa2dBTVNlb2N6UDlxbDlSNXMxLUJIekVtVEd3TmhGQ2tKOXhRU3lfTTZAxNnAxMHJfME4xWlMyRHZAtekZAR"
    },
    "next": "https://graph.facebook.com/v4.0/1332043400283557/friends?access_token=EAAG9BkJsduIBAJTdqdUJ4BYw9thbjDwGE30NbhMFHBBvxNAcOZAyRrzWwDohPfqEo8Iz55jt6zxfx4OJYu3wRZBxZADbg4t5e4GUJJ4eFiZCoZAPLhoHJQDP9RMnnq14y0nXFJz0ddwlh0udNzuhOMuUP7WWywOZCsr4rZBG7psD6HksNUNDdgjftZBc5T4A7LOeR0KCDZA7nbAZDZD&pretty=0&limit=1&after=QVFIUlNEN1BWay1jWVVfN05JSUt2Ri1FVEJ5dXBYa2dBTVNlb2N6UDlxbDlSNXMxLUJIekVtVEd3TmhGQ2tKOXhRU3lfTTZAxNnAxMHJfME4xWlMyRHZAtekZAR"
  },
  "summary": {
    "total_count": randomNumber
  }
}

@nbartels nbartels added this to the 3.3.0 milestone Feb 17, 2020
nbartels added a commit that referenced this issue Feb 18, 2020
We removed our own fix to build up a next and previous URL if the cursor pagination isn't providing the URLs. But now, we expect the URLs to be set correctly. We don't calculate them. Please report any problems as Github issue.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants