@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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.25.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.25.3...@stream-io/video-client-1.25.4) (2025-07-07)
6
+
7
+ ### Bug Fixes
8
+
9
+ - sync call state after a failed reconnect ([#1846](https://github.com/GetStream/stream-video-js/issues/1846)) ([905e5c2](https://github.com/GetStream/stream-video-js/commit/905e5c2011d3267e83b3f2a861a4175de4111cfa))
10
+
5
11
  ## [1.25.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.25.2...@stream-io/video-client-1.25.3) (2025-07-03)
6
12
 
7
13
  - bump the default test timeout ([bea27db](https://github.com/GetStream/stream-video-js/commit/bea27db1922a6f2a0899375d1a4cade1eb1291b5))
@@ -5810,7 +5810,7 @@ const aggregate = (stats) => {
5810
5810
  return report;
5811
5811
  };
5812
5812
 
5813
- const version = "1.25.3";
5813
+ const version = "1.25.4";
5814
5814
  const [major, minor, patch] = version.split('.');
5815
5815
  let sdkInfo = {
5816
5816
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -12054,6 +12054,16 @@ class Call {
12054
12054
  const reconnectStartTime = Date.now();
12055
12055
  this.reconnectStrategy = strategy;
12056
12056
  this.reconnectReason = reason;
12057
+ const markAsReconnectingFailed = async () => {
12058
+ try {
12059
+ // attempt to fetch the call data from the server, as the call
12060
+ // state might have changed while we were reconnecting or were offline
12061
+ await this.get();
12062
+ }
12063
+ finally {
12064
+ this.state.setCallingState(CallingState.RECONNECTING_FAILED);
12065
+ }
12066
+ };
12057
12067
  let attempt = 0;
12058
12068
  do {
12059
12069
  const reconnectingTime = Date.now() - reconnectStartTime;
@@ -12061,7 +12071,7 @@ class Call {
12061
12071
  reconnectingTime / 1000 > this.disconnectionTimeoutSeconds;
12062
12072
  if (shouldGiveUpReconnecting) {
12063
12073
  this.logger('warn', '[Reconnect] Stopping reconnection attempts after reaching disconnection timeout');
12064
- this.state.setCallingState(CallingState.RECONNECTING_FAILED);
12074
+ await markAsReconnectingFailed();
12065
12075
  return;
12066
12076
  }
12067
12077
  // we don't increment reconnect attempts for the FAST strategy.
@@ -12102,7 +12112,7 @@ class Call {
12102
12112
  }
12103
12113
  if (error instanceof ErrorFromResponse && error.unrecoverable) {
12104
12114
  this.logger('warn', `[Reconnect] Can't reconnect due to coordinator unrecoverable error`, error);
12105
- this.state.setCallingState(CallingState.RECONNECTING_FAILED);
12115
+ await markAsReconnectingFailed();
12106
12116
  return;
12107
12117
  }
12108
12118
  await sleep(500);
@@ -12139,6 +12149,7 @@ class Call {
12139
12149
  this.reconnectStrategy = WebsocketReconnectStrategy.FAST;
12140
12150
  this.state.setCallingState(CallingState.RECONNECTING);
12141
12151
  await this.doJoin(this.joinCallData);
12152
+ await this.get(); // fetch the latest call state, as it might have changed
12142
12153
  this.sfuStatsReporter?.sendReconnectionTime(WebsocketReconnectStrategy.FAST, (Date.now() - reconnectStartTime) / 1000);
12143
12154
  };
12144
12155
  /**
@@ -14273,7 +14284,7 @@ class StreamClient {
14273
14284
  this.getUserAgent = () => {
14274
14285
  if (!this.cachedUserAgent) {
14275
14286
  const { clientAppIdentifier = {} } = this.options;
14276
- const { sdkName = 'js', sdkVersion = "1.25.3", ...extras } = clientAppIdentifier;
14287
+ const { sdkName = 'js', sdkVersion = "1.25.4", ...extras } = clientAppIdentifier;
14277
14288
  this.cachedUserAgent = [
14278
14289
  `stream-video-${sdkName}-v${sdkVersion}`,
14279
14290
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),