stream-chat 8.13.1 → 8.14.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.
package/dist/browser.js CHANGED
@@ -1385,12 +1385,6 @@ var Channel = /*#__PURE__*/function () {
1385
1385
  * Static state indicates that channel exists on backend, but is not being watched yet.
1386
1386
  */
1387
1387
 
1388
- /**
1389
- * Collects the incoming WS events before the channel is marked as initialized.
1390
- * This prevents executing procedures that depend on channel being initialized.
1391
- * Once the channel is marked as initialized the queue is flushed.
1392
- */
1393
-
1394
1388
  /**
1395
1389
  * constructor - Create a channel
1396
1390
  *
@@ -1434,8 +1428,6 @@ var Channel = /*#__PURE__*/function () {
1434
1428
 
1435
1429
  _defineProperty__default['default'](this, "disconnected", void 0);
1436
1430
 
1437
- _defineProperty__default['default'](this, "wsEventQueue", void 0);
1438
-
1439
1431
  _defineProperty__default['default'](this, "create", /*#__PURE__*/function () {
1440
1432
  var _ref = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(options) {
1441
1433
  var defaultOptions;
@@ -1525,7 +1517,6 @@ var Channel = /*#__PURE__*/function () {
1525
1517
  this.lastTypingEvent = null;
1526
1518
  this.isTyping = false;
1527
1519
  this.disconnected = false;
1528
- this.wsEventQueue = [];
1529
1520
  }
1530
1521
  /**
1531
1522
  * getClient - Get the chat client for this channel. If client.disconnect() was called, this function will error
@@ -2929,9 +2920,6 @@ var Channel = /*#__PURE__*/function () {
2929
2920
  case 7:
2930
2921
  state = _context28.sent;
2931
2922
  this.initialized = true;
2932
-
2933
- this._flushWsEventQueue();
2934
-
2935
2923
  this.data = state.channel;
2936
2924
 
2937
2925
  this._client.logger('info', "channel:watch() - started watching channel ".concat(this.cid), {
@@ -2941,7 +2929,7 @@ var Channel = /*#__PURE__*/function () {
2941
2929
 
2942
2930
  return _context28.abrupt("return", state);
2943
2931
 
2944
- case 13:
2932
+ case 12:
2945
2933
  case "end":
2946
2934
  return _context28.stop();
2947
2935
  }
@@ -3664,11 +3652,6 @@ var Channel = /*#__PURE__*/function () {
3664
3652
 
3665
3653
  var channel = this;
3666
3654
 
3667
- if (!this._isInitialized()) {
3668
- this.wsEventQueue.push(event);
3669
- return;
3670
- }
3671
-
3672
3655
  this._client.logger('info', "channel:_handleChannelEvent - Received event of type { ".concat(event.type, " } on ").concat(this.cid), {
3673
3656
  tags: ['event', 'channel'],
3674
3657
  channel: this
@@ -3919,11 +3902,6 @@ var Channel = /*#__PURE__*/function () {
3919
3902
  channel.state.watcher_count = event.watcher_count;
3920
3903
  }
3921
3904
  }
3922
- }, {
3923
- key: "_isInitialized",
3924
- value: function _isInitialized() {
3925
- return this.initialized || this.offlineMode || this.getClient()._isUsingServerAuth();
3926
- }
3927
3905
  }, {
3928
3906
  key: "_checkInitialized",
3929
3907
  value: function _checkInitialized() {
@@ -4085,14 +4063,6 @@ var Channel = /*#__PURE__*/function () {
4085
4063
  this.disconnected = true;
4086
4064
  this.state.setIsUpToDate(false);
4087
4065
  }
4088
- }, {
4089
- key: "_flushWsEventQueue",
4090
- value: function _flushWsEventQueue() {
4091
- while (this.wsEventQueue.length) {
4092
- var event = this.wsEventQueue.shift();
4093
- if (event) this.getClient().dispatchEvent(event);
4094
- }
4095
- }
4096
4066
  }]);
4097
4067
 
4098
4068
  return Channel;
@@ -6664,7 +6634,6 @@ var StreamChat = /*#__PURE__*/function () {
6664
6634
 
6665
6635
  for (var _channelID in refMap) {
6666
6636
  var _channel2 = _this.activeChannels[_channelID];
6667
- /** search the members and watchers and update as needed... */
6668
6637
 
6669
6638
  if (_channel2 !== null && _channel2 !== void 0 && _channel2.state) {
6670
6639
  if (_channel2.state.members[user.id]) {
@@ -6674,6 +6643,10 @@ var StreamChat = /*#__PURE__*/function () {
6674
6643
  if (_channel2.state.watchers[user.id]) {
6675
6644
  _channel2.state.watchers[user.id] = user;
6676
6645
  }
6646
+
6647
+ if (_channel2.state.read[user.id]) {
6648
+ _channel2.state.read[user.id].user = user;
6649
+ }
6677
6650
  }
6678
6651
  }
6679
6652
  });
@@ -10186,7 +10159,7 @@ var StreamChat = /*#__PURE__*/function () {
10186
10159
  }, {
10187
10160
  key: "getUserAgent",
10188
10161
  value: function getUserAgent() {
10189
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.13.1");
10162
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.1");
10190
10163
  }
10191
10164
  }, {
10192
10165
  key: "setUserAgent",
@@ -11580,30 +11553,6 @@ var EVENT_MAP = {
11580
11553
  'connection.changed': true,
11581
11554
  'connection.recovered': true,
11582
11555
  'transport.changed': true
11583
- }; // events handled by channel._handleChannelEvent
11584
-
11585
- var CHANNEL_HANDLED_EVENTS = {
11586
- 'typing.start': true,
11587
- 'typing.stop': true,
11588
- 'message.read': true,
11589
- 'user.watching.start': true,
11590
- 'user.updated': true,
11591
- 'user.watching.stop': true,
11592
- 'message.deleted': true,
11593
- 'message.new': true,
11594
- 'message.updated': true,
11595
- 'channel.truncated': true,
11596
- 'member.added': true,
11597
- 'member.updated': true,
11598
- 'member.removed': true,
11599
- 'channel.updated': true,
11600
- 'reaction.new': true,
11601
- 'reaction.deleted': true,
11602
- 'reaction.updated': true,
11603
- 'channel.hidden': true,
11604
- 'channel.visible': true,
11605
- 'user.banned': true,
11606
- 'user.unbanned': true
11607
11556
  };
11608
11557
 
11609
11558
  var Allow = 'Allow';
@@ -11686,7 +11635,6 @@ exports.AnyResource = AnyResource;
11686
11635
  exports.AnyRole = AnyRole;
11687
11636
  exports.BuiltinPermissions = BuiltinPermissions;
11688
11637
  exports.BuiltinRoles = BuiltinRoles;
11689
- exports.CHANNEL_HANDLED_EVENTS = CHANNEL_HANDLED_EVENTS;
11690
11638
  exports.Channel = Channel;
11691
11639
  exports.ChannelState = ChannelState;
11692
11640
  exports.CheckSignature = CheckSignature;