Ruview/ui/services
rUv a70ca90525
Some checks are pending
Continuous Integration / Code Quality & Security (push) Waiting to run
Continuous Integration / Rust Workspace Tests (push) Waiting to run
Continuous Integration / UI JavaScript Tests (push) Waiting to run
Continuous Integration / Tests (push) Waiting to run
Continuous Integration / Tests-1 (push) Waiting to run
Continuous Integration / Tests-2 (push) Waiting to run
Continuous Integration / Performance Tests (push) Blocked by required conditions
Continuous Integration / Docker Build & Test (push) Blocked by required conditions
Continuous Integration / API Documentation (push) Blocked by required conditions
Continuous Integration / Notify (push) Blocked by required conditions
Fix-Marker Regression Guard / Verify fix markers (push) Waiting to run
Security Scanning / Static Application Security Testing (push) Waiting to run
Security Scanning / Dependency Vulnerability Scan (push) Waiting to run
Security Scanning / Container Security Scan (push) Waiting to run
Security Scanning / Infrastructure Security Scan (push) Waiting to run
Security Scanning / Secret Scanning (push) Waiting to run
Security Scanning / License Compliance Scan (push) Waiting to run
Security Scanning / Security Policy Compliance (push) Waiting to run
Security Scanning / Security Report (push) Blocked by required conditions
wifi-densepose sensing-server → Docker Hub + ghcr.io / build · push · smoke-test (push) Waiting to run
fix(ui): pose stream WebSocket 401s when RUVIEW_API_TOKEN is set (#1461) (#1462)
websocket.service.js (used by the pose/event streams) opened a bare
`new WebSocket(url)` with no ADR-272 ticket exchange, unlike
sensing.service.js which already mints a ticket per connect. Since a
browser cannot set an Authorization header on a WebSocket upgrade, and
the server rejects a long-lived bearer passed as a query string
(CWE-598), the pose stream 401'd whenever auth was on — visible in the
Live Demo tab as "Failed to create WebSocket connection".

Fix: createWebSocketWithTimeout() now strips any `token` query param a
caller put on the URL (pose.service.js does this) and exchanges the
stored bearer for a single-use `?ticket=` via withWsTicket(), done at
this one choke point so every consumer (pose, events, training) and
every reconnect attempt gets a fresh ticket.

Second, smaller bug: pose-fusion/js/main.js auto-connected to a
hardcoded `ws://localhost:8765/ws/sensing`, but the Docker image serves
the sensing WebSocket on :3001 (the same 3000->3001 mapping
sensing.service.js already encodes) — the auto-connect dialed a port
nothing listens on. Reuses that port mapping and tickets both the
auto-connect and the manual "Connect" button.

Bumped the pose-fusion.html cache-buster (v=13 -> v=14) so browsers
actually fetch the updated main.js.

Adds ui/services/websocket.service.test.mjs (4 executed Node tests,
stubbed WebSocket/fetch/localStorage) covering: no-auth passthrough,
ticket exchange + bearer-never-in-URL, stray ?token= stripping, and the
pre-ADR-272 404 fallback. Wired into the CI "Run UI unit tests" step.

Reported with a verified fix in #1461 by wsc7r4zcj4-collab; this PR
implements the same fix against current main with an added regression
test.

Closes #1461
2026-07-28 10:59:00 -04:00
..
api.service.js decide: browser sessions are read-only permanently; drop the dead step-up client 2026-07-23 14:47:31 +02:00
data-processor.js feat: Add Three.js visualization entry point and data processor 2026-02-28 06:29:28 +00:00
health.service.js feat: Sensing-only UI mode with Gaussian splat visualization and Rust migration ADR 2026-02-28 14:37:29 -05:00
model.service.js fix: WebSocket race condition, data source indicators, auto-start pose detection (#96) 2026-03-02 13:47:49 -05:00
pose.service.js fix: WebSocket race condition, data source indicators, auto-start pose detection (#96) 2026-03-02 13:47:49 -05:00
sensing.service.js feat(ui): fetch WebSocket tickets, prefix-match WS paths, and write ADR-272 2026-07-22 19:15:20 +02:00
stream.service.js Add comprehensive CSS styles for UI components and dark mode support 2025-06-07 13:28:02 +00:00
training.service.js fix: WebSocket race condition, data source indicators, auto-start pose detection (#96) 2026-03-02 13:47:49 -05:00
websocket-client.js feat(ui): fetch WebSocket tickets, prefix-match WS paths, and write ADR-272 2026-07-22 19:15:20 +02:00
websocket.service.js fix(ui): pose stream WebSocket 401s when RUVIEW_API_TOKEN is set (#1461) (#1462) 2026-07-28 10:59:00 -04:00
websocket.service.test.mjs fix(ui): pose stream WebSocket 401s when RUVIEW_API_TOKEN is set (#1461) (#1462) 2026-07-28 10:59:00 -04:00
ws-ticket.js feat(ui): fetch WebSocket tickets, prefix-match WS paths, and write ADR-272 2026-07-22 19:15:20 +02:00
ws-ticket.test.mjs fix(ui): service worker cached /oauth/status, freezing browser sign-in 2026-07-23 11:20:13 +02:00