From 1e7262ee247cbcbd715d1fe68744e0ef4d32af99 Mon Sep 17 00:00:00 2001 From: Ole Date: Sat, 13 Jun 2026 22:46:44 +0200 Subject: [PATCH] =?UTF-8?q?Room-Code:=20Retry=20in=20joinFromRoomCode=20(1?= =?UTF-8?q?0x500ms)=20f=C3=BCr=20Offer-Race-Condition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- p2p.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/p2p.js b/p2p.js index d36a51d..646ea6b 100644 --- a/p2p.js +++ b/p2p.js @@ -175,11 +175,13 @@ class MeshNet { this._pendingPeer = { peer, peerId: remoteId, connected: answerSent }; } - joinFromRoomCode(code) { + joinFromRoomCode(code, _retries = 10) { const key = `rp2p_offer_${code.toUpperCase()}`; const offerStr = localStorage.getItem(key); if (!offerStr) { - console.error('Room not found:', code); + if (_retries > 0) { + setTimeout(() => this.joinFromRoomCode(code, _retries - 1), 500); + } return; } const offerData = JSON.parse(offerStr);