Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
session cookie. Drops the WebSocket-embedded base64 path, fixing
Mobile Edge AAC playback and dramatically reducing per-call memory
pressure on the client.
- Service worker now passes audio fetches (`/api/calls/:id/audio` and
`/api/shared/:token/audio`) straight through to the network instead of
intercepting them. Lets the browser handle Range requests natively for
the `<audio>` element and avoids buffering full call bodies in the
worker.

### Fixed

Expand Down
11 changes: 11 additions & 0 deletions frontend/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ sw.addEventListener("fetch", (event) => {
const { request } = event;
const url = new URL(request.url);

// Pass through audio downloads untouched. Letting the SW intercept
// these would force-buffer the full body in memory and strip the
// browser's native Range-request handling that <audio> relies on.
// Matches /api/calls/:id/audio and /api/shared/:token/audio.
if (
/^\/api\/calls\/\d+\/audio$/.test(url.pathname) ||
/^\/api\/shared\/[^/]+\/audio$/.test(url.pathname)
) {
return;
}

// Network-first for API calls
if (url.pathname.startsWith("/api")) {
event.respondWith(
Expand Down
Loading