From ce020d641a22acf62aae5cb8ebd34fcd7b3a3449 Mon Sep 17 00:00:00 2001 From: "Claude Opus 4.7" Date: Thu, 21 May 2026 00:56:38 -0500 Subject: [PATCH] web: stop double-JSON-encoding the signal payload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Browser was JSON.stringify-ing the inner payload before putting it in the outer message envelope. Go side then saw a JSON string where it expected a JSON object, and SignalPayload Unmarshal silently failed — which is why answers never made it back through the peer connection. Co-Authored-By: Claude Opus 4.7 --- server/web/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/web/index.html b/server/web/index.html index 6c06e1a..bbf6ce4 100644 --- a/server/web/index.html +++ b/server/web/index.html @@ -164,7 +164,7 @@ type: "signal", from: peerID, source: "web", - signal: JSON.stringify(payload), + signal: payload, }), }); } @@ -216,8 +216,8 @@ try { const m = JSON.parse(ev.data); if (m.from === peerID) return; // ignore our own - let payload = m.signal; - if (typeof payload === "string") payload = JSON.parse(payload); + const payload = m.signal; + if (!payload) return; if (payload.kind === "offer" && payload.sdp) { handleOffer(payload.sdp.sdp); } else if (payload.kind === "ice" && payload.candidate) {