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.
@@ -12113,7 +12113,18 @@ var StableWSConnection = class {
12113
12113
  this._log("_reconnect() - Destroying current WS connection");
12114
12114
  this._destroyCurrentWSConnection();
12115
12115
  if (options.refreshToken) {
12116
- await this.client.tokenManager.loadToken();
12116
+ try {
12117
+ await this.client.tokenManager.loadToken();
12118
+ } catch (error) {
12119
+ this.isHealthy = false;
12120
+ this.consecutiveFailures += 1;
12121
+ this._log("_reconnect() - Failed to refresh the token", { error }, "warn");
12122
+ if (!this.isDisconnected) {
12123
+ this._log("_reconnect() - Going to try to reload token and reconnect");
12124
+ this._reconnect({ refreshToken: true });
12125
+ }
12126
+ return;
12127
+ }
12117
12128
  if (this.isConnecting || this.isHealthy) {
12118
12129
  this._log("_reconnect() - Abort (4) since already connecting or healthy");
12119
12130
  return;
@@ -14079,11 +14090,15 @@ var ChannelManager = class extends WithSubscriptions {
14079
14090
  sort
14080
14091
  });
14081
14092
  if (channelsFromDB) {
14082
- const offlineChannels = this.client.hydrateActiveChannels(channelsFromDB, {
14083
- offlineMode: true,
14084
- skipInitialization: []
14085
- // passing empty array will clear out the existing messages from channel state, this removes the possibility of duplicate messages
14086
- });
14093
+ const offlineChannels = this.client.hydrateActiveChannels(
14094
+ channelsFromDB,
14095
+ {
14096
+ offlineMode: true,
14097
+ skipInitialization: []
14098
+ // passing empty array will clear out the existing messages from channel state, this removes the possibility of duplicate messages
14099
+ },
14100
+ options
14101
+ );
14087
14102
  this.state.partialNext({ channels: offlineChannels });
14088
14103
  }
14089
14104
  }
@@ -15524,7 +15539,7 @@ var StreamChat = class _StreamChat {
15524
15539
  return this.userAgent;
15525
15540
  }
15526
15541
  if (!this.cachedUserAgent) {
15527
- const version = "9.54.2";
15542
+ const version = "9.54.4";
15528
15543
  const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
15529
15544
  const { name: appName, version: appVersion } = this.appIdentifier ?? {};
15530
15545
  const { os, model: deviceModel } = this.deviceIdentifier ?? {};