From 7554959baa5b67a6a1a80ef83583298acc5a14a5 Mon Sep 17 00:00:00 2001 From: Siavash Sameni Date: Sun, 12 Apr 2026 13:22:00 +0400 Subject: [PATCH] fix(ui): show correct P2P Direct / Via Relay badge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The UI looked for event "connect:dual_path_race_won" which doesn't exist — the actual event is "connect:path_negotiated" with a use_direct boolean. Badge always showed "Via Relay" even when the call was direct P2P. Co-Authored-By: Claude Opus 4.6 (1M context) --- desktop/src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/src/main.ts b/desktop/src/main.ts index 8796faf..be6b4c4 100644 --- a/desktop/src/main.ts +++ b/desktop/src/main.ts @@ -1015,10 +1015,10 @@ async function pollStatus() { if (directCallPeer) { // Check the debug buffer for the race result to label // the connection type (P2P Direct vs Relay). - const raceWon = callDebugBuffer.find((e) => e.step === "connect:dual_path_race_won"); + const pathNeg = callDebugBuffer.find((e) => e.step === "connect:path_negotiated"); const engineOk = callDebugBuffer.find((e) => e.step === "connect:call_engine_started"); if (engineOk) { - if (raceWon?.details?.path === "Direct") { + if (pathNeg?.details?.use_direct === true) { dcBadge.textContent = "P2P Direct"; dcBadge.className = "dc-badge"; } else {