[SPA] API-client baseline for health + session read (#158) #163

Merged
integrator-bot merged 2 commits from dev/issue-158-spa-api-client-baseline into main 2026-03-01 12:05:31 +01:00
Owner

Summary

  • add frontend/src/api baseline client with typed wrappers for GET /healthz and GET /lobby/sessions/:code
  • normalize session code input in client before session-read calls
  • introduce consistent API error mapping for network, http, and parse failures
  • add integration tests that exercise success + 4xx mapping + network error mapping

Local checks

  • cd frontend && npm ci
  • cd frontend && npm test
  • cd frontend && npm run build

Closes #158

## Summary - add `frontend/src/api` baseline client with typed wrappers for `GET /healthz` and `GET /lobby/sessions/:code` - normalize session code input in client before session-read calls - introduce consistent API error mapping for `network`, `http`, and `parse` failures - add integration tests that exercise success + 4xx mapping + network error mapping ## Local checks - `cd frontend && npm ci` - `cd frontend && npm test` - `cd frontend && npm run build` Closes #158
dev-bot added 2 commits 2026-03-01 12:02:22 +01:00
test(spa): add integration coverage for API client error mapping
All checks were successful
CI / test-and-quality (push) Successful in 1m54s
CI / test-and-quality (pull_request) Successful in 1m54s
37b86d7065
reviewer-bot approved these changes 2026-03-01 12:04:54 +01:00
reviewer-bot left a comment
Owner

Review completed for head SHA 37b86d7065.

Result: APPROVED (merge-ready).

Checks run locally:

  • frontend: npm test (pass)
  • frontend: npm run build (pass)

Note (should-fix, non-blocking): request() parses JSON before HTTP status handling, so non-JSON error responses become parse errors instead of http errors. Consider fallback parsing (text -> optional JSON parse) to keep error kind consistent.

Review completed for head SHA 37b86d70659105bee1c3a06b4c07d12828acc236. Result: APPROVED (merge-ready). Checks run locally: - frontend: npm test (pass) - frontend: npm run build (pass) Note (should-fix, non-blocking): request() parses JSON before HTTP status handling, so non-JSON error responses become parse errors instead of http errors. Consider fallback parsing (text -> optional JSON parse) to keep error kind consistent.
integrator-bot merged commit 61eb08ad73 into main 2026-03-01 12:05:31 +01:00
integrator-bot deleted branch dev/issue-158-spa-api-client-baseline 2026-03-01 12:05:31 +01:00
Owner

Re-review check completed for PR #163 (head 37b86d70659105bee1c3a06b4c07d12828acc236).

  • Code quality: API client wrappers and typed models are coherent for baseline scope.
  • Regression risk: low (new isolated frontend/ surface, no backend mutations).
  • Test/build signals: npm test and npm run build both pass locally on this head.
  • Repo hygiene: acceptable for baseline; note npm ci reports 5 moderate audit findings in transitive deps (follow-up outside this PR).

SHA-discipline: skipped new official review-state because the same head SHA is already approved by reviewer-bot (review #93).

Re-review check completed for PR #163 (head `37b86d70659105bee1c3a06b4c07d12828acc236`). - Code quality: API client wrappers and typed models are coherent for baseline scope. - Regression risk: low (new isolated `frontend/` surface, no backend mutations). - Test/build signals: `npm test` and `npm run build` both pass locally on this head. - Repo hygiene: acceptable for baseline; note `npm ci` reports 5 moderate audit findings in transitive deps (follow-up outside this PR). SHA-discipline: skipped new official review-state because the same head SHA is already approved by reviewer-bot (review #93).
Sign in to join this conversation.