stream-chat 8.13.1 → 8.14.0

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.
@@ -1360,12 +1360,6 @@ var Channel = /*#__PURE__*/function () {
1360
1360
  * Static state indicates that channel exists on backend, but is not being watched yet.
1361
1361
  */
1362
1362
 
1363
- /**
1364
- * Collects the incoming WS events before the channel is marked as initialized.
1365
- * This prevents executing procedures that depend on channel being initialized.
1366
- * Once the channel is marked as initialized the queue is flushed.
1367
- */
1368
-
1369
1363
  /**
1370
1364
  * constructor - Create a channel
1371
1365
  *
@@ -1409,8 +1403,6 @@ var Channel = /*#__PURE__*/function () {
1409
1403
 
1410
1404
  _defineProperty(this, "disconnected", void 0);
1411
1405
 
1412
- _defineProperty(this, "wsEventQueue", void 0);
1413
-
1414
1406
  _defineProperty(this, "create", /*#__PURE__*/function () {
1415
1407
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
1416
1408
  var defaultOptions;
@@ -1500,7 +1492,6 @@ var Channel = /*#__PURE__*/function () {
1500
1492
  this.lastTypingEvent = null;
1501
1493
  this.isTyping = false;
1502
1494
  this.disconnected = false;
1503
- this.wsEventQueue = [];
1504
1495
  }
1505
1496
  /**
1506
1497
  * getClient - Get the chat client for this channel. If client.disconnect() was called, this function will error
@@ -2904,9 +2895,6 @@ var Channel = /*#__PURE__*/function () {
2904
2895
  case 7:
2905
2896
  state = _context28.sent;
2906
2897
  this.initialized = true;
2907
-
2908
- this._flushWsEventQueue();
2909
-
2910
2898
  this.data = state.channel;
2911
2899
 
2912
2900
  this._client.logger('info', "channel:watch() - started watching channel ".concat(this.cid), {
@@ -2916,7 +2904,7 @@ var Channel = /*#__PURE__*/function () {
2916
2904
 
2917
2905
  return _context28.abrupt("return", state);
2918
2906
 
2919
- case 13:
2907
+ case 12:
2920
2908
  case "end":
2921
2909
  return _context28.stop();
2922
2910
  }
@@ -3639,11 +3627,6 @@ var Channel = /*#__PURE__*/function () {
3639
3627
 
3640
3628
  var channel = this;
3641
3629
 
3642
- if (!this._isInitialized()) {
3643
- this.wsEventQueue.push(event);
3644
- return;
3645
- }
3646
-
3647
3630
  this._client.logger('info', "channel:_handleChannelEvent - Received event of type { ".concat(event.type, " } on ").concat(this.cid), {
3648
3631
  tags: ['event', 'channel'],
3649
3632
  channel: this
@@ -3894,11 +3877,6 @@ var Channel = /*#__PURE__*/function () {
3894
3877
  channel.state.watcher_count = event.watcher_count;
3895
3878
  }
3896
3879
  }
3897
- }, {
3898
- key: "_isInitialized",
3899
- value: function _isInitialized() {
3900
- return this.initialized || this.offlineMode || this.getClient()._isUsingServerAuth();
3901
- }
3902
3880
  }, {
3903
3881
  key: "_checkInitialized",
3904
3882
  value: function _checkInitialized() {
@@ -4060,14 +4038,6 @@ var Channel = /*#__PURE__*/function () {
4060
4038
  this.disconnected = true;
4061
4039
  this.state.setIsUpToDate(false);
4062
4040
  }
4063
- }, {
4064
- key: "_flushWsEventQueue",
4065
- value: function _flushWsEventQueue() {
4066
- while (this.wsEventQueue.length) {
4067
- var event = this.wsEventQueue.shift();
4068
- if (event) this.getClient().dispatchEvent(event);
4069
- }
4070
- }
4071
4041
  }]);
4072
4042
 
4073
4043
  return Channel;
@@ -10161,7 +10131,7 @@ var StreamChat = /*#__PURE__*/function () {
10161
10131
  }, {
10162
10132
  key: "getUserAgent",
10163
10133
  value: function getUserAgent() {
10164
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.13.1");
10134
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.0");
10165
10135
  }
10166
10136
  }, {
10167
10137
  key: "setUserAgent",
@@ -11555,30 +11525,6 @@ var EVENT_MAP = {
11555
11525
  'connection.changed': true,
11556
11526
  'connection.recovered': true,
11557
11527
  'transport.changed': true
11558
- }; // events handled by channel._handleChannelEvent
11559
-
11560
- var CHANNEL_HANDLED_EVENTS = {
11561
- 'typing.start': true,
11562
- 'typing.stop': true,
11563
- 'message.read': true,
11564
- 'user.watching.start': true,
11565
- 'user.updated': true,
11566
- 'user.watching.stop': true,
11567
- 'message.deleted': true,
11568
- 'message.new': true,
11569
- 'message.updated': true,
11570
- 'channel.truncated': true,
11571
- 'member.added': true,
11572
- 'member.updated': true,
11573
- 'member.removed': true,
11574
- 'channel.updated': true,
11575
- 'reaction.new': true,
11576
- 'reaction.deleted': true,
11577
- 'reaction.updated': true,
11578
- 'channel.hidden': true,
11579
- 'channel.visible': true,
11580
- 'user.banned': true,
11581
- 'user.unbanned': true
11582
11528
  };
11583
11529
 
11584
11530
  var Allow = 'Allow';
@@ -11655,5 +11601,5 @@ var BuiltinPermissions = {
11655
11601
  UseFrozenChannel: 'Send messages and reactions to frozen channels'
11656
11602
  };
11657
11603
 
11658
- export { Allow, AllowAll, AnyResource, AnyRole, BuiltinPermissions, BuiltinRoles, CHANNEL_HANDLED_EVENTS, Channel, ChannelState, CheckSignature, ClientState, Deny, DenyAll, DevToken, EVENT_MAP, ErrorFromResponse, InsightMetrics, JWTServerToken, JWTUserToken, MaxPriority, MinPriority, Permission, StableWSConnection, StreamChat, TokenManager, UserFromToken, buildWsFatalInsight, buildWsSuccessAfterFailureInsight, chatCodes, decodeBase64, encodeBase64, isOwnUser, logChatPromiseExecution, postInsights };
11604
+ export { Allow, AllowAll, AnyResource, AnyRole, BuiltinPermissions, BuiltinRoles, Channel, ChannelState, CheckSignature, ClientState, Deny, DenyAll, DevToken, EVENT_MAP, ErrorFromResponse, InsightMetrics, JWTServerToken, JWTUserToken, MaxPriority, MinPriority, Permission, StableWSConnection, StreamChat, TokenManager, UserFromToken, buildWsFatalInsight, buildWsSuccessAfterFailureInsight, chatCodes, decodeBase64, encodeBase64, isOwnUser, logChatPromiseExecution, postInsights };
11659
11605
  //# sourceMappingURL=browser.es.js.map