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
package/dist/cjs/index.node.js
CHANGED
|
@@ -12082,7 +12082,18 @@ var StableWSConnection = class {
|
|
|
12082
12082
|
this._log("_reconnect() - Destroying current WS connection");
|
|
12083
12083
|
this._destroyCurrentWSConnection();
|
|
12084
12084
|
if (options.refreshToken) {
|
|
12085
|
-
|
|
12085
|
+
try {
|
|
12086
|
+
await this.client.tokenManager.loadToken();
|
|
12087
|
+
} catch (error) {
|
|
12088
|
+
this.isHealthy = false;
|
|
12089
|
+
this.consecutiveFailures += 1;
|
|
12090
|
+
this._log("_reconnect() - Failed to refresh the token", { error }, "warn");
|
|
12091
|
+
if (!this.isDisconnected) {
|
|
12092
|
+
this._log("_reconnect() - Going to try to reload token and reconnect");
|
|
12093
|
+
this._reconnect({ refreshToken: true });
|
|
12094
|
+
}
|
|
12095
|
+
return;
|
|
12096
|
+
}
|
|
12086
12097
|
if (this.isConnecting || this.isHealthy) {
|
|
12087
12098
|
this._log("_reconnect() - Abort (4) since already connecting or healthy");
|
|
12088
12099
|
return;
|
|
@@ -14048,11 +14059,15 @@ var ChannelManager = class extends WithSubscriptions {
|
|
|
14048
14059
|
sort
|
|
14049
14060
|
});
|
|
14050
14061
|
if (channelsFromDB) {
|
|
14051
|
-
const offlineChannels = this.client.hydrateActiveChannels(
|
|
14052
|
-
|
|
14053
|
-
|
|
14054
|
-
|
|
14055
|
-
|
|
14062
|
+
const offlineChannels = this.client.hydrateActiveChannels(
|
|
14063
|
+
channelsFromDB,
|
|
14064
|
+
{
|
|
14065
|
+
offlineMode: true,
|
|
14066
|
+
skipInitialization: []
|
|
14067
|
+
// passing empty array will clear out the existing messages from channel state, this removes the possibility of duplicate messages
|
|
14068
|
+
},
|
|
14069
|
+
options
|
|
14070
|
+
);
|
|
14056
14071
|
this.state.partialNext({ channels: offlineChannels });
|
|
14057
14072
|
}
|
|
14058
14073
|
}
|
|
@@ -15493,7 +15508,7 @@ var StreamChat = class _StreamChat {
|
|
|
15493
15508
|
return this.userAgent;
|
|
15494
15509
|
}
|
|
15495
15510
|
if (!this.cachedUserAgent) {
|
|
15496
|
-
const version = "9.54.
|
|
15511
|
+
const version = "9.54.4";
|
|
15497
15512
|
const { name: sdkName, version: sdkVersion } = this.sdkIdentifier ?? {};
|
|
15498
15513
|
const { name: appName, version: appVersion } = this.appIdentifier ?? {};
|
|
15499
15514
|
const { os, model: deviceModel } = this.deviceIdentifier ?? {};
|