ory / ory/network

Link to next page in empty response

Open
#392 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Shell
Stars
96
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
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
  1. Send a GET request to https://{slug}.projects.oryapis.com/admin/identities/{uuid-of-non-existent-identity}/sessions
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.