@stream-io/video-client 1.25.3 → 1.25.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.browser.es.js +15 -4
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +15 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +15 -4
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Call.ts +13 -2
package/package.json
CHANGED
package/src/Call.ts
CHANGED
|
@@ -1358,6 +1358,16 @@ export class Call {
|
|
|
1358
1358
|
this.reconnectStrategy = strategy;
|
|
1359
1359
|
this.reconnectReason = reason;
|
|
1360
1360
|
|
|
1361
|
+
const markAsReconnectingFailed = async () => {
|
|
1362
|
+
try {
|
|
1363
|
+
// attempt to fetch the call data from the server, as the call
|
|
1364
|
+
// state might have changed while we were reconnecting or were offline
|
|
1365
|
+
await this.get();
|
|
1366
|
+
} finally {
|
|
1367
|
+
this.state.setCallingState(CallingState.RECONNECTING_FAILED);
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1361
1371
|
let attempt = 0;
|
|
1362
1372
|
do {
|
|
1363
1373
|
const reconnectingTime = Date.now() - reconnectStartTime;
|
|
@@ -1370,7 +1380,7 @@ export class Call {
|
|
|
1370
1380
|
'warn',
|
|
1371
1381
|
'[Reconnect] Stopping reconnection attempts after reaching disconnection timeout',
|
|
1372
1382
|
);
|
|
1373
|
-
|
|
1383
|
+
await markAsReconnectingFailed();
|
|
1374
1384
|
return;
|
|
1375
1385
|
}
|
|
1376
1386
|
|
|
@@ -1430,7 +1440,7 @@ export class Call {
|
|
|
1430
1440
|
`[Reconnect] Can't reconnect due to coordinator unrecoverable error`,
|
|
1431
1441
|
error,
|
|
1432
1442
|
);
|
|
1433
|
-
|
|
1443
|
+
await markAsReconnectingFailed();
|
|
1434
1444
|
return;
|
|
1435
1445
|
}
|
|
1436
1446
|
|
|
@@ -1483,6 +1493,7 @@ export class Call {
|
|
|
1483
1493
|
this.reconnectStrategy = WebsocketReconnectStrategy.FAST;
|
|
1484
1494
|
this.state.setCallingState(CallingState.RECONNECTING);
|
|
1485
1495
|
await this.doJoin(this.joinCallData);
|
|
1496
|
+
await this.get(); // fetch the latest call state, as it might have changed
|
|
1486
1497
|
this.sfuStatsReporter?.sendReconnectionTime(
|
|
1487
1498
|
WebsocketReconnectStrategy.FAST,
|
|
1488
1499
|
(Date.now() - reconnectStartTime) / 1000,
|