fix: 10s timeout on handshake CallAnswer; button stays visible during connect

- handshake.rs: add 10s timeout on recv_signal() waiting for CallAnswer —
  previously hung forever if relay didn't respond, making join button
  disappear with no feedback
- main.ts: keep join button visible + show "Connecting…" state instead of
  hiding it before the await; button restores correctly on error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-05-25 06:59:57 +04:00
parent 32c07d1b61
commit b0a3b1f18e
2 changed files with 14 additions and 8 deletions

View File

@@ -331,7 +331,9 @@ joinVoiceBtn.addEventListener("click", async () => {
const s = loadSettings();
if (!relay) { showToast("No relay configured"); return; }
connectPending = true;
joinVoiceBtn.classList.add("hidden");
const origText = joinVoiceBtn.textContent;
joinVoiceBtn.textContent = "Connecting…";
(joinVoiceBtn as HTMLButtonElement).disabled = true;
try {
await invoke("connect", {
relay: relay.address,
@@ -344,9 +346,10 @@ joinVoiceBtn.addEventListener("click", async () => {
} catch (e: any) {
console.error("connect failed:", e);
showToast(`Join failed: ${e}`);
joinVoiceBtn.classList.remove("hidden");
} finally {
connectPending = false;
joinVoiceBtn.textContent = origText;
(joinVoiceBtn as HTMLButtonElement).disabled = false;
}
});