Hi, I was wondering if someone could help me with ...
# talk-kratos
j
Hi, I was wondering if someone could help me with the pager available in the Ory identities API. It seems that leveraging the pager I can never get through the entire record set as the pager at some points stops having a next and last section, even though there are still plenty of records. This behaviour is consistent in every call.
For example the first call you can see:
Copy code
{
  "next": {
    "page": "1",
    "page_size": "250",
    "page_token": "eyJvZmZzZXQiOiIyNTAiLCJ2IjoyfQ",
    "per_page": "250",
    "rel": "next",
    "url": "<https://example.projects.oryapis.com/identities?page=1&page_size=250&page_token=eyJvZmZzZXQiOiIyNTAiLCJ2IjoyfQ&per_page=250>"
  },
  "last": {
    "page": "7",
    "page_size": "250",
    "page_token": "eyJvZmZzZXQiOiIxNzUwIiwidiI6Mn0",
    "per_page": "250",
    "rel": "last",
    "url": "https:/example.projects.oryapis.com/identities?page=7&page_size=250&page_token=eyJvZmZzZXQiOiIxNzUwIiwidiI6Mn0&per_page=250"
  }
}
which tells me there are 8 pages of records (which is correct)
however as I get to page=4, I get this pager:
Copy code
{
  "first": {
    "page": "0",
    "page_size": "250",
    "page_token": "eyJvZmZzZXQiOiIwIiwidiI6Mn0",
    "per_page": "250",
    "rel": "first",
    "url": "<https://example.projects.oryapis.com/identities?page=0&page_size=250&page_token=eyJvZmZzZXQiOiIwIiwidiI6Mn0&per_page=250>"
  },
  "prev": {
    "page": "3",
    "page_size": "250",
    "page_token": "eyJvZmZzZXQiOiI3NTAiLCJ2IjoyfQ",
    "per_page": "250",
    "rel": "prev",
    "url": "<https://example.projects.oryapis.com/identities?page=3&page_size=250&page_token=eyJvZmZzZXQiOiI3NTAiLCJ2IjoyfQ&per_page=250>"
  }
}
as you can see it's clearly page 4 (and correctly showing the page 3 as previous), but not showing next pages, which stops my code flow.
either I'm missing something (likely) or the pager isn't working correctly
h
@steep-lamp-91158 did you not fix this?
Looks like we had a fix that was rolled back. I’m bringing this back up to PM
s
No this is buggy, we will fix it soon. You can, as a workaround, use the last page you get in the first call and iterate until you reach it.
j
got it
I managed to workaround it for now, just thought I'd raise it 👌