Spaces:
Runtime error
Runtime error
Fix call ICE race: keep pre-PC candidates and load RTC config first (v2.8.2)
Browse files- client.js +2 -3
- index.html +2 -2
- package.json +1 -1
client.js
CHANGED
|
@@ -1059,7 +1059,7 @@ function connectSocket() {
|
|
| 1059 |
}
|
| 1060 |
}
|
| 1061 |
|
| 1062 |
-
if (signal.type === 'ice-candidate' &&
|
| 1063 |
await addOrQueueIceCandidate(signal.candidate);
|
| 1064 |
}
|
| 1065 |
} catch (error) {
|
|
@@ -6458,15 +6458,14 @@ async function startCallSession(peerName, peerId, isCaller) {
|
|
| 6458 |
currentCallPeerId = peerId;
|
| 6459 |
currentCallPeerName = peerName;
|
| 6460 |
callIceFailureCount = 0;
|
|
|
|
| 6461 |
forceRelayOnly = rtcRuntimeConfig?.iceTransportPolicy === 'relay';
|
| 6462 |
-
pendingRemoteIceCandidates = [];
|
| 6463 |
|
| 6464 |
openCallDialog(peerName);
|
| 6465 |
// Start timer from session start to avoid "stuck at 00:00" perception on unstable networks.
|
| 6466 |
if (!callTimerInterval) {
|
| 6467 |
startCallTimer();
|
| 6468 |
}
|
| 6469 |
-
await ensureRtcConfigLoaded();
|
| 6470 |
try {
|
| 6471 |
await ensureLocalCallStream();
|
| 6472 |
} catch (mediaError) {
|
|
|
|
| 1059 |
}
|
| 1060 |
}
|
| 1061 |
|
| 1062 |
+
if (signal.type === 'ice-candidate' && signal.candidate) {
|
| 1063 |
await addOrQueueIceCandidate(signal.candidate);
|
| 1064 |
}
|
| 1065 |
} catch (error) {
|
|
|
|
| 6458 |
currentCallPeerId = peerId;
|
| 6459 |
currentCallPeerName = peerName;
|
| 6460 |
callIceFailureCount = 0;
|
| 6461 |
+
await ensureRtcConfigLoaded();
|
| 6462 |
forceRelayOnly = rtcRuntimeConfig?.iceTransportPolicy === 'relay';
|
|
|
|
| 6463 |
|
| 6464 |
openCallDialog(peerName);
|
| 6465 |
// Start timer from session start to avoid "stuck at 00:00" perception on unstable networks.
|
| 6466 |
if (!callTimerInterval) {
|
| 6467 |
startCallTimer();
|
| 6468 |
}
|
|
|
|
| 6469 |
try {
|
| 6470 |
await ensureLocalCallStream();
|
| 6471 |
} catch (mediaError) {
|
index.html
CHANGED
|
@@ -3098,7 +3098,7 @@
|
|
| 3098 |
<div class="chat-header-title" id="chatTitle">💬 Select a friend to chat</div>
|
| 3099 |
</div>
|
| 3100 |
<div class="chat-header-actions">
|
| 3101 |
-
<span class="build-badge mobile-essential" id="buildVersionBadge" title="Frontend build version">v2.8.
|
| 3102 |
<button class="header-btn mobile-essential" onclick="toggleArchiveChat()" title="Archive chat">
|
| 3103 |
<i class="fas fa-archive"></i>
|
| 3104 |
</button>
|
|
@@ -3717,7 +3717,7 @@
|
|
| 3717 |
|
| 3718 |
<script src="/socket.io/socket.io.js"></script>
|
| 3719 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
|
| 3720 |
-
<script src="client.js?v=2.8.
|
| 3721 |
</body>
|
| 3722 |
</html>
|
| 3723 |
|
|
|
|
| 3098 |
<div class="chat-header-title" id="chatTitle">💬 Select a friend to chat</div>
|
| 3099 |
</div>
|
| 3100 |
<div class="chat-header-actions">
|
| 3101 |
+
<span class="build-badge mobile-essential" id="buildVersionBadge" title="Frontend build version">v2.8.2</span>
|
| 3102 |
<button class="header-btn mobile-essential" onclick="toggleArchiveChat()" title="Archive chat">
|
| 3103 |
<i class="fas fa-archive"></i>
|
| 3104 |
</button>
|
|
|
|
| 3717 |
|
| 3718 |
<script src="/socket.io/socket.io.js"></script>
|
| 3719 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
|
| 3720 |
+
<script src="client.js?v=2.8.2"></script>
|
| 3721 |
</body>
|
| 3722 |
</html>
|
| 3723 |
|
package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "discord-like-app",
|
| 3 |
-
"version": "2.8.
|
| 4 |
"main": "server.js",
|
| 5 |
"scripts": {
|
| 6 |
"dev": "nodemon server.js",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "discord-like-app",
|
| 3 |
+
"version": "2.8.2",
|
| 4 |
"main": "server.js",
|
| 5 |
"scripts": {
|
| 6 |
"dev": "nodemon server.js",
|