stream-chat 9.43.0 → 9.43.1

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.
@@ -3254,7 +3254,7 @@ var _AttachmentManager = class _AttachmentManager {
3254
3254
  this.setCustomUploadFn = (doUploadRequest) => {
3255
3255
  this.composer.updateConfig({ attachments: { doUploadRequest } });
3256
3256
  };
3257
- this.cancelAttachmentUploads = (attachments) => {
3257
+ this.cancelAttachmentUploads = (attachments = this.attachments) => {
3258
3258
  for (const { localMetadata } of attachments) {
3259
3259
  this.client.uploadManager.deleteUploadRecord(localMetadata.id);
3260
3260
  }
@@ -3272,7 +3272,6 @@ var _AttachmentManager = class _AttachmentManager {
3272
3272
  };
3273
3273
  };
3274
3274
  this.initState = ({ message } = {}) => {
3275
- this.cancelAttachmentUploads(this.attachments);
3276
3275
  this.state.next(initState({ message }));
3277
3276
  };
3278
3277
  this.getSnapshot = () => {
@@ -4139,7 +4138,9 @@ var applyCommandActivationEffect = (effect, composer) => {
4139
4138
  selection: { start: 0, end: 0 },
4140
4139
  text: ""
4141
4140
  });
4141
+ const attachmentsToCancel = composer.attachmentManager.attachments;
4142
4142
  composer.attachmentManager.initState();
4143
+ composer.attachmentManager.cancelAttachmentUploads(attachmentsToCancel);
4143
4144
  composer.linkPreviewsManager.initState();
4144
4145
  composer.locationComposer.initState();
4145
4146
  composer.pollComposer.initState();
@@ -10434,8 +10435,9 @@ var StableWSConnection = class {
10434
10435
  this.onmessage = (wsID, event) => {
10435
10436
  if (this.wsID !== wsID) return;
10436
10437
  this._log("onmessage() - onmessage callback", { event, wsID });
10437
- const data = typeof event.data === "string" ? JSON.parse(event.data) : null;
10438
- if (!this.isResolved && data) {
10438
+ if (typeof event.data !== "string") return;
10439
+ const data = JSON.parse(event.data);
10440
+ if (!this.isResolved) {
10439
10441
  this.isResolved = true;
10440
10442
  if (data.error) {
10441
10443
  this.rejectPromise?.(this._errorFromWSEvent(data, false));
@@ -10445,10 +10447,10 @@ var StableWSConnection = class {
10445
10447
  this._setHealth(true);
10446
10448
  }
10447
10449
  this.lastEvent = /* @__PURE__ */ new Date();
10448
- if (data && data.type === "health.check") {
10450
+ if (data.type === "health.check") {
10449
10451
  this.scheduleNextPing();
10450
10452
  }
10451
- this.client.handleEvent(event);
10453
+ this.client.dispatchEvent(data);
10452
10454
  this.scheduleConnectionCheck();
10453
10455
  };
10454
10456
  this.onclose = (wsID, event) => {
@@ -13551,11 +13553,6 @@ var StreamChat = class _StreamChat {
13551
13553
  method: `handleEvent;${event.type}`
13552
13554
  });
13553
13555
  };
13554
- this.handleEvent = (messageEvent) => {
13555
- const jsonString = messageEvent.data;
13556
- const event = JSON.parse(jsonString);
13557
- this.dispatchEvent(event);
13558
- };
13559
13556
  /**
13560
13557
  * Updates the members, watchers and read references of the currently active channels that contain this user
13561
13558
  *
@@ -15643,7 +15640,7 @@ var StreamChat = class _StreamChat {
15643
15640
  if (this.userAgent) {
15644
15641
  return this.userAgent;
15645
15642
  }
15646
- const version = "9.43.0";
15643
+ const version = "9.43.1";
15647
15644
  const clientBundle = "node-cjs";
15648
15645
  let userAgentString = "";
15649
15646
  if (this.sdkIdentifier) {