stream-chat 9.54.2 → 9.54.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.
@@ -11890,7 +11890,18 @@ var StableWSConnection = class {
11890
11890
  this._log("_reconnect() - Destroying current WS connection");
11891
11891
  this._destroyCurrentWSConnection();
11892
11892
  if (options.refreshToken) {
11893
- await this.client.tokenManager.loadToken();
11893
+ try {
11894
+ await this.client.tokenManager.loadToken();
11895
+ } catch (error) {
11896
+ this.isHealthy = false;
11897
+ this.consecutiveFailures += 1;
11898
+ this._log("_reconnect() - Failed to refresh the token", { error }, "warn");
11899
+ if (!this.isDisconnected) {
11900
+ this._log("_reconnect() - Going to try to reload token and reconnect");
11901
+ this._reconnect({ refreshToken: true });
11902
+ }
11903
+ return;
11904
+ }
11894
11905
  if (this.isConnecting || this.isHealthy) {
11895
11906
  this._log("_reconnect() - Abort (4) since already connecting or healthy");
11896
11907
  return;
@@ -13856,11 +13867,15 @@ var ChannelManager = class extends WithSubscriptions {
13856
13867
  sort
13857
13868
  });
13858
13869
  if (channelsFromDB) {
13859
- const offlineChannels = this.client.hydrateActiveChannels(channelsFromDB, {
13860
- offlineMode: true,
13861
- skipInitialization: []
13862
- // passing empty array will clear out the existing messages from channel state, this removes the possibility of duplicate messages
13863
- });
13870
+ const offlineChannels = this.client.hydrateActiveChannels(
13871
+ channelsFromDB,
13872
+ {
13873
+ offlineMode: true,
13874
+ skipInitialization: []
13875
+ // passing empty array will clear out the existing messages from channel state, this removes the possibility of duplicate messages
13876
+ },
13877
+ options
13878
+ );
13864
13879
  this.state.partialNext({ channels: offlineChannels });
13865
13880
  }
13866
13881
  }
@@ -15301,7 +15316,7 @@ var StreamChat = class _StreamChat {
15301
15316
  return this.userAgent;
15302
15317
  }
15303
15318
  if (!this.cachedUserAgent) {
15304
- const version = "9.54.2";
15319
+ const version = "9.54.4";
15305
15320
  const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
15306
15321
  const { name: appName, version: appVersion } = this.appIdentifier ?? {};
15307
15322
  const { os, model: deviceModel } = this.deviceIdentifier ?? {};