From b1905a21fc8c286ac6ec63084acc73f6689e719d Mon Sep 17 00:00:00 2001 From: thanipro Date: Sat, 2 May 2026 10:48:07 +0200 Subject: [PATCH 1/2] partytracks: pass fetchImpl on /generate-ice-servers fetch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `makePeerConnectionSessionCombo`'s `iceServers` arm of the forkJoin wasn't passing `fetchImpl: options.fetch`, so even when a consumer configured a custom `fetch` on `PartyTracksConfig` (e.g. to inject an Authorization header), the GET fell back to the global `fetch` with no consumer headers. The matching `sessionId` arm two lines above already passed `fetchImpl: options.fetch`. This brings the iceServers arm in line. No behavior change for consumers without a custom fetch — `fetchImpl` defaults to global fetch via fromFetch.ts:35. Caught when `tranqbay/call` ran with an authenticated `/partytracks/*` proxy: POST /sessions/new succeeded, GET /generate-ice-servers 401'd. Symmetric NAT clients then fell back to STUN-only ICE. --- packages/partytracks/src/client/PartyTracks.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/partytracks/src/client/PartyTracks.ts b/packages/partytracks/src/client/PartyTracks.ts index 3546f621..fcb00c81 100644 --- a/packages/partytracks/src/client/PartyTracks.ts +++ b/packages/partytracks/src/client/PartyTracks.ts @@ -761,6 +761,7 @@ function makePeerConnectionSessionCombo(options: { iceServers: options.iceServers ? of(options.iceServers) : fromFetch(`${options.prefix}/generate-ice-servers`, { + fetchImpl: options.fetch, selector: (res) => res .json() From c962b1a2623c98fcfee7a0ebe6c98d625d052d85 Mon Sep 17 00:00:00 2001 From: thanipro Date: Sat, 2 May 2026 11:07:35 +0200 Subject: [PATCH 2/2] add changeset for /generate-ice-servers fetchImpl fix --- .changeset/sleek-otters-pass-fetch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/sleek-otters-pass-fetch.md diff --git a/.changeset/sleek-otters-pass-fetch.md b/.changeset/sleek-otters-pass-fetch.md new file mode 100644 index 00000000..98cce839 --- /dev/null +++ b/.changeset/sleek-otters-pass-fetch.md @@ -0,0 +1,5 @@ +--- +"partytracks": patch +--- + +Pass `options.fetch` to `fromFetch` when fetching `/generate-ice-servers`. The matching `sessions/new` request already uses it, so a consumer that wires up a custom `fetch` via `PartyTracksConfig.fetch` (for auth headers, tracing, retries, request signing, etc.) now gets it applied uniformly across both calls instead of just one. No behavior change for consumers that don't pass a custom fetch — `fetchImpl` defaults to the global `fetch` in `fromFetch.ts`.