Link to next page in empty response
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 96
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
https://stupefied-hofstadter-ynu7i1qy5i.projects.oryapis.com
Describe the bug
When I try listing sessions of an identity, but I use an identifier of a non-existent identity,
- I get a successful 200 OK response (I'd expect 404),
- the response contains a Link header with links to first, next and prev pages.
Reproducing the bug
- Send a GET request to https://{slug}.projects.oryapis.com/admin/identities/{uuid-of-non-existent-identity}/sessions
- Response i 200 OK, body contains an empty array, Link header contains links to first, next and prev pages.
Relevant log output
</admin/identities/175754a0-803a-4f92-b1f0-e6d71a844be7/sessions?page=0&page_size=250&page_token=eyJvZmZzZXQiOiIwIiwidiI6Mn0&per_page=250>; rel="first",</admin/identities/175754a0-803a-4f92-b1f0-e6d71a844be7/sessions?page=1&page_size=250&page_token=eyJvZmZzZXQiOiIyNTAiLCJ2IjoyfQ&per_page=250>; rel="next",</admin/identities/175754a0-803a-4f92-b1f0-e6d71a844be7/sessions?page=-1&page_size=250&page_token=eyJvZmZzZXQiOiItMjUwIiwidiI6Mn0&per_page=250>; rel="prev"
Relevant configuration
No response
Version
On which operating system are you observing this issue?
None
In which environment are you deploying?
Ory Network
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the GET /admin/identities/{uuid-of-non-existent-identity}/sessions request described in the issue and inspect the API handling for a missing identity and its pagination Link generation. Done means the missing identity returns 404 rather than 200 with an empty array, and does not emit misleading first, next, or prev links; add regression coverage if the project provides a relevant test location.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100