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.
- package/dist/cjs/index.browser.js +22 -7
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +22 -7
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +22 -7
- package/dist/esm/index.mjs.map +2 -2
- package/package.json +1 -1
- package/src/channel_manager.ts +8 -4
- package/src/connection.ts +15 -1
|
@@ -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
|
-
|
|
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(
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
|
|
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.
|
|
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 ?? {};
|