feature/USERS #12

Merged
ab merged 5 commits from feature/USERS into DEV 2026-04-08 16:51:25 +00:00
Owner
No description provided.
ab added 5 commits 2026-04-08 16:51:20 +00:00
Add a Service Worker that intercepts /api/* requests and injects the
Bearer token. This allows <audio> and <img> elements to use direct
URLs instead of downloading entire files as blobs first.

- Audio now streams progressively (no full download before playback)
- Cover art loads via regular <img src> (SW adds auth header)
- Remove blob-based preloadStream, fetchCoverBlob, useCoverUrl hook
- Register SW in main.tsx, token synced via postMessage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Service Worker only intercepts same-origin requests. In dev mode, API
calls went directly to localhost:8085 (cross-origin), bypassing the SW.
Now vite proxies /api to Rust API, keeping everything same-origin so
the SW can inject Bearer tokens for audio/image requests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
postMessage is unreliable on first load — SW may not be active yet.
IndexedDB is shared between page and SW, so the token is always
available regardless of SW lifecycle timing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
<audio> elements with Sec-Fetch-Mode: no-cors are unreliable with
Service Workers across browsers. Revert stream to blob download via
axios (Bearer token works). SW remains for cover art in <img> tags.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(node-player): use AuthImg component for cover art with Bearer auth
Publish Web Player Image / build-and-push-image (push) Has been cancelled
Publish Node Player Image / build-and-push-image (push) Has been cancelled
Publish Metadata Agent Image / build-and-push-image (push) Has been cancelled
4a39d44211
SW doesn't reliably intercept <img> requests (no-cors mode). Use a
thin AuthImg component that loads images via axios (which has the
Bearer token) and displays them as blob URLs. Audio streaming still
works via SW.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ab merged commit 5c7f940b7e into DEV 2026-04-08 16:51:25 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ab/furumi-ng#12