test(e2e): accept both paginated and legacy session-list shapes #201

Merged
nrupard merged 1 commit from fix/BUNYIP-183-sessions-e2e-shape-transition into main 2026-06-23 18:12:13 +02:00
Member

The account-sessions e2e probe asserts the session list returned by GET /users/me/sessions. The suite runs against a live deployment and, on a pull_request, the PR's code is never deployed (e2e.yml runs a /health reachability check, not a deploy), so the test always runs against whatever staging currently serves.

BUNYIP-177 (PR #200) reshaped this endpoint from the legacy { data: { sessions: [...] } } envelope to the paginated { data: { items: [...], ... } } envelope and updated the assertion to read data.items. Against staging still serving the legacy shape, data.items is undefined, the list falls back to [], and the "expected at least one active session" assertion fails with 0 (run #852).

Read the list from data.items first and fall back to data.sessions, so the assertion passes regardless of which shape the deployment currently serves. This survives the window between merge and deploy for any response-shape change to this endpoint, and is the pattern the paginated PR should adopt.

#BUNYIP-183

The account-sessions e2e probe asserts the session list returned by GET /users/me/sessions. The suite runs against a live deployment and, on a pull_request, the PR's code is never deployed (e2e.yml runs a /health reachability check, not a deploy), so the test always runs against whatever staging currently serves. BUNYIP-177 (PR #200) reshaped this endpoint from the legacy `{ data: { sessions: [...] } }` envelope to the paginated `{ data: { items: [...], ... } }` envelope and updated the assertion to read `data.items`. Against staging still serving the legacy shape, `data.items` is undefined, the list falls back to `[]`, and the "expected at least one active session" assertion fails with 0 (run #852). Read the list from `data.items` first and fall back to `data.sessions`, so the assertion passes regardless of which shape the deployment currently serves. This survives the window between merge and deploy for any response-shape change to this endpoint, and is the pattern the paginated PR should adopt. #BUNYIP-183
test(e2e): accept both paginated and legacy session-list shapes
All checks were successful
E2E / Playwright against deployment (pull_request) Successful in 54s
Check / fmt + clippy + build + tests (pull_request) Successful in 4m23s
Create release / Create release from merged PR (pull_request) Has been skipped
61ee86271f
The account-sessions e2e probe asserts the session list returned by GET /users/me/sessions. The suite runs against a live deployment and, on a pull_request, the PR's code is never deployed (e2e.yml runs a /health reachability check, not a deploy), so the test always runs against whatever staging currently serves.

BUNYIP-177 (PR #200) reshaped this endpoint from the legacy `{ data: { sessions: [...] } }` envelope to the paginated `{ data: { items: [...], ... } }` envelope and updated the assertion to read `data.items`. Against staging still serving the legacy shape, `data.items` is undefined, the list falls back to `[]`, and the "expected at least one active session" assertion fails with 0 (run #852).

Read the list from `data.items` first and fall back to `data.sessions`, so the assertion passes regardless of which shape the deployment currently serves. This survives the window between merge and deploy for any response-shape change to this endpoint, and is the pattern the paginated PR should adopt.

#BUNYIP-183
nrupard scheduled this pull request to auto merge when all checks succeed 2026-06-23 18:07:55 +02:00
nrupard deleted branch fix/BUNYIP-183-sessions-e2e-shape-transition 2026-06-23 18:12:13 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!201
No description provided.