sceyt-chat-react-uikit 1.8.9-beta.6 → 1.8.9-beta.8

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.
Files changed (3) hide show
  1. package/index.js +237 -407
  2. package/index.modern.js +237 -407
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -12613,6 +12613,15 @@ var removeAudioRecordingFromMap = function removeAudioRecordingFromMap(channelId
12613
12613
  delete audioRecordingMap[channelId];
12614
12614
  };
12615
12615
  var setDraftMessageToMap = function setDraftMessageToMap(channelId, draftMessage) {
12616
+ var _draftMessage$attachm, _draftMessage$text, _draftMessage$editMes;
12617
+ var hasAttachments = !!((_draftMessage$attachm = draftMessage.attachments) !== null && _draftMessage$attachm !== void 0 && _draftMessage$attachm.length);
12618
+ var hasComposeText = !draftMessage.messageToEdit && !!((_draftMessage$text = draftMessage.text) !== null && _draftMessage$text !== void 0 && _draftMessage$text.trim());
12619
+ var editText = ((_draftMessage$editMes = draftMessage.editMessageText) === null || _draftMessage$editMes === void 0 ? void 0 : _draftMessage$editMes.trim()) || '';
12620
+ var hasChangedEdit = !!draftMessage.messageToEdit && !!editText && (draftMessage.editMessageText !== draftMessage.messageToEdit.body || JSON.stringify(draftMessage.editBodyAttributes || []) !== JSON.stringify(draftMessage.messageToEdit.bodyAttributes || []));
12621
+ if (!hasComposeText && !hasAttachments && !hasChangedEdit) {
12622
+ removeDraftMessageFromMap(channelId);
12623
+ return;
12624
+ }
12616
12625
  draftMessagesMap[channelId] = draftMessage;
12617
12626
  Promise.resolve(persistDraft(channelId, draftMessage))["catch"](function () {
12618
12627
  return undefined;
@@ -25666,81 +25675,52 @@ function watchForEvents() {
25666
25675
  }, _marked0$1);
25667
25676
  }
25668
25677
 
25669
- var READ_MESSAGE_LOG_KEY_ALIASES = {
25670
- source: 's',
25671
- channelId: 'ch',
25672
- readAll: 'ra',
25673
- messageIds: 'mi',
25674
- messageId: 'm',
25675
- connectionStatus: 'cs',
25676
- attempts: 'at',
25677
- retryDelayMs: 'rd',
25678
- requestedMessageIds: 'rq',
25679
- confirmedMessageIds: 'cf',
25680
- isVisible: 'iv',
25681
- alreadyRead: 'ar',
25682
- disableAutoReadTracking: 'da',
25683
- isTabActive: 'ta',
25684
- newMessageCount: 'nm',
25685
- queued: 'q',
25686
- localRef: 'lr',
25687
- visibleCandidateIds: 'vc',
25688
- unreadScrollTo: 'us',
25689
- pendingFrameScheduled: 'pf'
25690
- };
25691
- var compactReadMessageLogData = function compactReadMessageLogData(data) {
25692
- return JSON.stringify(Object.fromEntries(Object.entries(data).map(function (_ref) {
25693
- var key = _ref[0],
25694
- value = _ref[1];
25695
- return [READ_MESSAGE_LOG_KEY_ALIASES[key] || key.slice(0, 2), value];
25696
- })));
25697
- };
25698
-
25699
25678
  var _marked$3 = /*#__PURE__*/_regenerator().m(applyChannelReadProgress),
25700
- _marked2$3 = /*#__PURE__*/_regenerator().m(createChannel),
25701
- _marked3$2 = /*#__PURE__*/_regenerator().m(getChannels),
25702
- _marked4$2 = /*#__PURE__*/_regenerator().m(searchChannels),
25703
- _marked5$2 = /*#__PURE__*/_regenerator().m(getChannelsForForward),
25704
- _marked6$2 = /*#__PURE__*/_regenerator().m(searchChannelsForForward),
25705
- _marked7$2 = /*#__PURE__*/_regenerator().m(channelsLoadMore),
25706
- _marked8$2 = /*#__PURE__*/_regenerator().m(getChannelMentions),
25707
- _marked9$2 = /*#__PURE__*/_regenerator().m(channelsForForwardLoadMore),
25708
- _marked0$2 = /*#__PURE__*/_regenerator().m(markMessagesRead),
25709
- _marked1$1 = /*#__PURE__*/_regenerator().m(markVoiceMessageAsPlayed),
25710
- _marked10$1 = /*#__PURE__*/_regenerator().m(updateMessageAsOpened),
25711
- _marked11$1 = /*#__PURE__*/_regenerator().m(markMessageAsOpened),
25712
- _marked12$1 = /*#__PURE__*/_regenerator().m(markMessagesDelivered),
25713
- _marked13$1 = /*#__PURE__*/_regenerator().m(switchChannel),
25714
- _marked14$1 = /*#__PURE__*/_regenerator().m(notificationsTurnOff),
25715
- _marked15$1 = /*#__PURE__*/_regenerator().m(notificationsTurnOn),
25716
- _marked16$1 = /*#__PURE__*/_regenerator().m(markChannelAsRead),
25717
- _marked17$1 = /*#__PURE__*/_regenerator().m(resendPendingChannelReads),
25718
- _marked18$1 = /*#__PURE__*/_regenerator().m(markChannelAsUnRead),
25719
- _marked19$1 = /*#__PURE__*/_regenerator().m(pinChannel),
25720
- _marked20$1 = /*#__PURE__*/_regenerator().m(unpinChannel),
25721
- _marked21$1 = /*#__PURE__*/_regenerator().m(removeChannelCaches),
25722
- _marked22$1 = /*#__PURE__*/_regenerator().m(leaveChannel),
25723
- _marked23$1 = /*#__PURE__*/_regenerator().m(deletePendingDeleteChannels),
25724
- _marked24$1 = /*#__PURE__*/_regenerator().m(deleteChannel),
25725
- _marked25$1 = /*#__PURE__*/_regenerator().m(blockChannel),
25726
- _marked26$1 = /*#__PURE__*/_regenerator().m(updateChannel),
25727
- _marked27$1 = /*#__PURE__*/_regenerator().m(checkUsersStatus),
25728
- _marked28$1 = /*#__PURE__*/_regenerator().m(sendTyping),
25729
- _marked29$1 = /*#__PURE__*/_regenerator().m(sendRecording),
25730
- _marked30$1 = /*#__PURE__*/_regenerator().m(clearHistory),
25731
- _marked31$1 = /*#__PURE__*/_regenerator().m(deleteAllMessages),
25732
- _marked32$1 = /*#__PURE__*/_regenerator().m(joinChannel),
25733
- _marked33$1 = /*#__PURE__*/_regenerator().m(watchForChannelEvents),
25734
- _marked34$1 = /*#__PURE__*/_regenerator().m(createChannelInviteKey),
25735
- _marked35$1 = /*#__PURE__*/_regenerator().m(getChannelInviteKeys),
25736
- _marked36$1 = /*#__PURE__*/_regenerator().m(regenerateChannelInviteKey),
25737
- _marked37$1 = /*#__PURE__*/_regenerator().m(updateChannelInviteKey),
25738
- _marked38$1 = /*#__PURE__*/_regenerator().m(getChannelByInviteKey),
25739
- _marked39$1 = /*#__PURE__*/_regenerator().m(joinChannelWithInviteKey),
25740
- _marked40$1 = /*#__PURE__*/_regenerator().m(setMessageRetentionPeriod),
25741
- _marked41$1 = /*#__PURE__*/_regenerator().m(getChannelsWithUser),
25742
- _marked42$1 = /*#__PURE__*/_regenerator().m(loadMoreMutualChannels),
25743
- _marked43$1 = /*#__PURE__*/_regenerator().m(ChannelsSaga);
25679
+ _marked2$3 = /*#__PURE__*/_regenerator().m(confirmDisplayedRead),
25680
+ _marked3$2 = /*#__PURE__*/_regenerator().m(createChannel),
25681
+ _marked4$2 = /*#__PURE__*/_regenerator().m(getChannels),
25682
+ _marked5$2 = /*#__PURE__*/_regenerator().m(searchChannels),
25683
+ _marked6$2 = /*#__PURE__*/_regenerator().m(getChannelsForForward),
25684
+ _marked7$2 = /*#__PURE__*/_regenerator().m(searchChannelsForForward),
25685
+ _marked8$2 = /*#__PURE__*/_regenerator().m(channelsLoadMore),
25686
+ _marked9$2 = /*#__PURE__*/_regenerator().m(getChannelMentions),
25687
+ _marked0$2 = /*#__PURE__*/_regenerator().m(channelsForForwardLoadMore),
25688
+ _marked1$1 = /*#__PURE__*/_regenerator().m(markMessagesRead),
25689
+ _marked10$1 = /*#__PURE__*/_regenerator().m(markVoiceMessageAsPlayed),
25690
+ _marked11$1 = /*#__PURE__*/_regenerator().m(updateMessageAsOpened),
25691
+ _marked12$1 = /*#__PURE__*/_regenerator().m(markMessageAsOpened),
25692
+ _marked13$1 = /*#__PURE__*/_regenerator().m(markMessagesDelivered),
25693
+ _marked14$1 = /*#__PURE__*/_regenerator().m(switchChannel),
25694
+ _marked15$1 = /*#__PURE__*/_regenerator().m(notificationsTurnOff),
25695
+ _marked16$1 = /*#__PURE__*/_regenerator().m(notificationsTurnOn),
25696
+ _marked17$1 = /*#__PURE__*/_regenerator().m(markChannelAsRead),
25697
+ _marked18$1 = /*#__PURE__*/_regenerator().m(resendPendingChannelReads),
25698
+ _marked19$1 = /*#__PURE__*/_regenerator().m(markChannelAsUnRead),
25699
+ _marked20$1 = /*#__PURE__*/_regenerator().m(pinChannel),
25700
+ _marked21$1 = /*#__PURE__*/_regenerator().m(unpinChannel),
25701
+ _marked22$1 = /*#__PURE__*/_regenerator().m(removeChannelCaches),
25702
+ _marked23$1 = /*#__PURE__*/_regenerator().m(leaveChannel),
25703
+ _marked24$1 = /*#__PURE__*/_regenerator().m(deletePendingDeleteChannels),
25704
+ _marked25$1 = /*#__PURE__*/_regenerator().m(deleteChannel),
25705
+ _marked26$1 = /*#__PURE__*/_regenerator().m(blockChannel),
25706
+ _marked27$1 = /*#__PURE__*/_regenerator().m(updateChannel),
25707
+ _marked28$1 = /*#__PURE__*/_regenerator().m(checkUsersStatus),
25708
+ _marked29$1 = /*#__PURE__*/_regenerator().m(sendTyping),
25709
+ _marked30$1 = /*#__PURE__*/_regenerator().m(sendRecording),
25710
+ _marked31$1 = /*#__PURE__*/_regenerator().m(clearHistory),
25711
+ _marked32$1 = /*#__PURE__*/_regenerator().m(deleteAllMessages),
25712
+ _marked33$1 = /*#__PURE__*/_regenerator().m(joinChannel),
25713
+ _marked34$1 = /*#__PURE__*/_regenerator().m(watchForChannelEvents),
25714
+ _marked35$1 = /*#__PURE__*/_regenerator().m(createChannelInviteKey),
25715
+ _marked36$1 = /*#__PURE__*/_regenerator().m(getChannelInviteKeys),
25716
+ _marked37$1 = /*#__PURE__*/_regenerator().m(regenerateChannelInviteKey),
25717
+ _marked38$1 = /*#__PURE__*/_regenerator().m(updateChannelInviteKey),
25718
+ _marked39$1 = /*#__PURE__*/_regenerator().m(getChannelByInviteKey),
25719
+ _marked40$1 = /*#__PURE__*/_regenerator().m(joinChannelWithInviteKey),
25720
+ _marked41$1 = /*#__PURE__*/_regenerator().m(setMessageRetentionPeriod),
25721
+ _marked42$1 = /*#__PURE__*/_regenerator().m(getChannelsWithUser),
25722
+ _marked43$1 = /*#__PURE__*/_regenerator().m(loadMoreMutualChannels),
25723
+ _marked44$1 = /*#__PURE__*/_regenerator().m(ChannelsSaga);
25744
25724
  var getUniqueMessageIds = function getUniqueMessageIds(messageIds) {
25745
25725
  if (messageIds === void 0) {
25746
25726
  messageIds = [];
@@ -25842,104 +25822,80 @@ function applyChannelReadProgress(channelId, updateData) {
25842
25822
  var shouldKeepQueuedPendingRead = function shouldKeepQueuedPendingRead(error) {
25843
25823
  return isResendableError(error === null || error === void 0 ? void 0 : error.type);
25844
25824
  };
25845
- var getReadMarkerLogContext = function getReadMarkerLogContext(pendingRead, source, messageIds) {
25846
- return {
25847
- source: source,
25848
- channelId: pendingRead.channelId,
25849
- readAll: pendingRead.readAll,
25850
- messageIds: messageIds
25851
- };
25852
- };
25853
- function confirmDisplayedRead(channel, pendingRead, source) {
25854
- if (source === void 0) {
25855
- source = 'initial';
25856
- }
25857
- return /*#__PURE__*/_regenerator().m(function _callee() {
25858
- var messageIds, logContext, attempt, connectionStatus, messageListMarker, _t;
25859
- return _regenerator().w(function (_context2) {
25860
- while (1) switch (_context2.p = _context2.n) {
25861
- case 0:
25862
- messageIds = getUniqueMessageIds(pendingRead.messageIds);
25863
- logContext = getReadMarkerLogContext(pendingRead, source, messageIds);
25864
- attempt = 0;
25865
- case 1:
25866
- if (!(attempt <= READ_MARKER_RETRY_DELAYS_MS.length)) {
25867
- _context2.n = 10;
25868
- break;
25869
- }
25870
- connectionStatus = store.getState().UserReducer.connectionStatus;
25871
- if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
25872
- _context2.n = 2;
25873
- break;
25874
- }
25875
- log.warn('[READ_MESSAGE] Queued read marker because connection is not ready', compactReadMessageLogData(_extends({}, logContext, {
25876
- connectionStatus: connectionStatus
25877
- })));
25878
- return _context2.a(2, {
25879
- status: 'queued'
25880
- });
25881
- case 2:
25882
- _context2.p = 2;
25883
- if (!pendingRead.readAll) {
25884
- _context2.n = 4;
25885
- break;
25886
- }
25887
- _context2.n = 3;
25888
- return effects.call(channel.markAsRead);
25889
- case 3:
25890
- return _context2.a(2, {
25891
- status: 'success'
25892
- });
25893
- case 4:
25894
- _context2.n = 5;
25895
- return effects.call(channel.markMessagesAsDisplayed, messageIds);
25896
- case 5:
25897
- messageListMarker = _context2.v;
25898
- return _context2.a(2, {
25899
- status: 'success',
25900
- messageListMarker: messageListMarker
25901
- });
25902
- case 6:
25903
- _context2.p = 6;
25904
- _t = _context2.v;
25905
- if (shouldKeepQueuedPendingRead(_t)) {
25906
- _context2.n = 7;
25907
- break;
25908
- }
25909
- log.error(_t, '[READ_MESSAGE] Dropping read marker after non-resendable error', compactReadMessageLogData(logContext));
25910
- return _context2.a(2, {
25911
- status: 'drop',
25912
- error: _t
25913
- });
25914
- case 7:
25915
- if (!(attempt === READ_MARKER_RETRY_DELAYS_MS.length)) {
25916
- _context2.n = 8;
25917
- break;
25918
- }
25919
- log.error(_t, '[READ_MESSAGE] Exhausted read marker retries; keeping queued for replay', compactReadMessageLogData(_extends({}, logContext, {
25920
- attempts: attempt + 1
25921
- })));
25922
- return _context2.a(2, {
25923
- status: 'queued',
25924
- error: _t
25925
- });
25926
- case 8:
25927
- log.warn(_t, "[READ_MESSAGE] Retrying read marker (" + (attempt + 1) + "/" + READ_MARKER_RETRY_DELAYS_MS.length + ")", compactReadMessageLogData(_extends({}, logContext, {
25928
- retryDelayMs: READ_MARKER_RETRY_DELAYS_MS[attempt]
25929
- })));
25930
- _context2.n = 9;
25931
- return effects.call(waitForReadMarkerRetry, READ_MARKER_RETRY_DELAYS_MS[attempt]);
25932
- case 9:
25933
- attempt++;
25934
- _context2.n = 1;
25825
+ function confirmDisplayedRead(channel, pendingRead) {
25826
+ var messageIds, attempt, connectionStatus, messageListMarker, _t;
25827
+ return _regenerator().w(function (_context2) {
25828
+ while (1) switch (_context2.p = _context2.n) {
25829
+ case 0:
25830
+ messageIds = getUniqueMessageIds(pendingRead.messageIds);
25831
+ attempt = 0;
25832
+ case 1:
25833
+ if (!(attempt <= READ_MARKER_RETRY_DELAYS_MS.length)) {
25834
+ _context2.n = 10;
25935
25835
  break;
25936
- case 10:
25937
- return _context2.a(2, {
25938
- status: 'queued'
25939
- });
25940
- }
25941
- }, _callee, null, [[2, 6]]);
25942
- })();
25836
+ }
25837
+ connectionStatus = store.getState().UserReducer.connectionStatus;
25838
+ if (!(connectionStatus !== CONNECTION_STATUS.CONNECTED)) {
25839
+ _context2.n = 2;
25840
+ break;
25841
+ }
25842
+ return _context2.a(2, {
25843
+ status: 'queued'
25844
+ });
25845
+ case 2:
25846
+ _context2.p = 2;
25847
+ if (!pendingRead.readAll) {
25848
+ _context2.n = 4;
25849
+ break;
25850
+ }
25851
+ _context2.n = 3;
25852
+ return effects.call(channel.markAsRead);
25853
+ case 3:
25854
+ return _context2.a(2, {
25855
+ status: 'success'
25856
+ });
25857
+ case 4:
25858
+ _context2.n = 5;
25859
+ return effects.call(channel.markMessagesAsDisplayed, messageIds);
25860
+ case 5:
25861
+ messageListMarker = _context2.v;
25862
+ return _context2.a(2, {
25863
+ status: 'success',
25864
+ messageListMarker: messageListMarker
25865
+ });
25866
+ case 6:
25867
+ _context2.p = 6;
25868
+ _t = _context2.v;
25869
+ if (shouldKeepQueuedPendingRead(_t)) {
25870
+ _context2.n = 7;
25871
+ break;
25872
+ }
25873
+ return _context2.a(2, {
25874
+ status: 'drop',
25875
+ error: _t
25876
+ });
25877
+ case 7:
25878
+ if (!(attempt === READ_MARKER_RETRY_DELAYS_MS.length)) {
25879
+ _context2.n = 8;
25880
+ break;
25881
+ }
25882
+ return _context2.a(2, {
25883
+ status: 'queued',
25884
+ error: _t
25885
+ });
25886
+ case 8:
25887
+ _context2.n = 9;
25888
+ return effects.call(waitForReadMarkerRetry, READ_MARKER_RETRY_DELAYS_MS[attempt]);
25889
+ case 9:
25890
+ attempt++;
25891
+ _context2.n = 1;
25892
+ break;
25893
+ case 10:
25894
+ return _context2.a(2, {
25895
+ status: 'queued'
25896
+ });
25897
+ }
25898
+ }, _marked2$3, null, [[2, 6]]);
25943
25899
  }
25944
25900
  function createChannel(action) {
25945
25901
  var payload, channelData, dontCreateIfNotExists, callback, SceytChatClient, createChannelData, fileToUpload, isSelfChannel, channelIsExistOnAllChannels, createdChannel, allChannels, memberId, whoDoesNotAdded, checkChannelExist, messageToSend, _allChannels, _memberId, _t2;
@@ -26137,7 +26093,7 @@ function createChannel(action) {
26137
26093
  case 19:
26138
26094
  return _context3.a(2);
26139
26095
  }
26140
- }, _marked2$3, null, [[0, 18]]);
26096
+ }, _marked3$2, null, [[0, 18]]);
26141
26097
  }
26142
26098
  function getChannels(action) {
26143
26099
  var _params$filter, _types, _activeChannel, _mappedChannels, _mappedChannels3, _mappedChannels4, payload, params, SceytChatClient, connectionStatus, channelQueryBuilder, channelTypesFilter, types, limit, channelQuery, channelsData, channelList, channelId, activeChannel, pendingLastMessages, _yield$call, mappedChannels, channelsForUpdateLastReactionMessage, _loop, _i, _Object$keys, _Object$keys2, _Object$keys3, _mappedChannels2, channelMessageMap, _iterator, _step, _lastMsg$userMarkers, ch, lastMsg, _activeChannel2, _activeChannel3, hiddenList, allChannelsQueryBuilder, allChannelsQuery, hasNext, totalAllChannelsAdded, i, _connectionStatus, allChannelsData, allChannelList, _t3, _t4, _t5;
@@ -26235,7 +26191,7 @@ function getChannels(action) {
26235
26191
  _yield$call = _context5.v;
26236
26192
  mappedChannels = _yield$call.channels;
26237
26193
  channelsForUpdateLastReactionMessage = _yield$call.channelsForUpdateLastReactionMessage;
26238
- _loop = /*#__PURE__*/_regenerator().m(function _callee2() {
26194
+ _loop = /*#__PURE__*/_regenerator().m(function _callee() {
26239
26195
  var _store$getState$Chann;
26240
26196
  var channelId, pendingLastMessage, currentReduxLastMessage, resolvedLastMessage, mappedChannel, mapEntry;
26241
26197
  return _regenerator().w(function (_context4) {
@@ -26262,7 +26218,7 @@ function getChannels(action) {
26262
26218
  case 1:
26263
26219
  return _context4.a(2);
26264
26220
  }
26265
- }, _callee2);
26221
+ }, _callee);
26266
26222
  });
26267
26223
  _i = 0, _Object$keys = Object.keys(pendingLastMessages);
26268
26224
  case 14:
@@ -26456,7 +26412,7 @@ function getChannels(action) {
26456
26412
  case 38:
26457
26413
  return _context5.a(2);
26458
26414
  }
26459
- }, _marked3$2, null, [[27, 30], [1, 37]]);
26415
+ }, _marked4$2, null, [[27, 30], [1, 37]]);
26460
26416
  }
26461
26417
  function searchChannels(action) {
26462
26418
  var payload, params, contactsMap, SceytChatClient, getFromContacts, searchBy, _params$filter2, _types2, channelQueryBuilder, channelTypesFilter, types, allChannels, publicChannels, chatsGroups, contactsList, contactsWithChannelsMap, lowerCaseSearchBy, handleChannels, channelsMap, _iterator2, _step2, channel, channelQuery, channelsData, _iterator3, _step3, _channel, channelsToAdd, _t6;
@@ -26589,7 +26545,7 @@ function searchChannels(action) {
26589
26545
  case 8:
26590
26546
  return _context6.a(2);
26591
26547
  }
26592
- }, _marked4$2, null, [[0, 7]]);
26548
+ }, _marked5$2, null, [[0, 7]]);
26593
26549
  }
26594
26550
  function getChannelsForForward() {
26595
26551
  var _SceytChatClient, channelQueryBuilder, channelTypesFilter, channelQuery, channelsData, channelsToAdd, _yield$call2, mappedChannels, _t7;
@@ -26647,7 +26603,7 @@ function getChannelsForForward() {
26647
26603
  case 9:
26648
26604
  return _context7.a(2);
26649
26605
  }
26650
- }, _marked5$2, null, [[0, 8]]);
26606
+ }, _marked6$2, null, [[0, 8]]);
26651
26607
  }
26652
26608
  function searchChannelsForForward(action) {
26653
26609
  var payload, params, _contactsMap, _SceytChatClient2, _getFromContacts, searchBy, _params$filter3, _types3, channelQueryBuilder, channelTypesFilter, types, allChannels, _publicChannels, _chatsGroups, contactsList, _contactsWithChannelsMap, _lowerCaseSearchBy, handleChannels, channelsMap, _iterator4, _step4, channel, channelQuery, channelsData, _iterator5, _step5, _channel2, channelsToAdd, _t8;
@@ -26779,7 +26735,7 @@ function searchChannelsForForward(action) {
26779
26735
  case 8:
26780
26736
  return _context8.a(2);
26781
26737
  }
26782
- }, _marked6$2, null, [[0, 7]]);
26738
+ }, _marked7$2, null, [[0, 7]]);
26783
26739
  }
26784
26740
  function channelsLoadMore(action) {
26785
26741
  var _mappedChannels5, _mappedChannels7, _mappedChannels8, payload, limit, channelQuery, channelsData, channelList, _yield$call3, mappedChannels, channelsForUpdateLastReactionMessage, _Object$keys4, _mappedChannels6, channelMessageMap, _t9;
@@ -26900,7 +26856,7 @@ function channelsLoadMore(action) {
26900
26856
  case 13:
26901
26857
  return _context9.a(2);
26902
26858
  }
26903
- }, _marked7$2, null, [[1, 12]]);
26859
+ }, _marked8$2, null, [[1, 12]]);
26904
26860
  }
26905
26861
  function getChannelMentions(action) {
26906
26862
  var payload, channelId, _SceytChatClient3, mentionsQueryBuilder, mentionsQuery, mentions, _t0;
@@ -26937,7 +26893,7 @@ function getChannelMentions(action) {
26937
26893
  case 5:
26938
26894
  return _context0.a(2);
26939
26895
  }
26940
- }, _marked8$2, null, [[0, 4]]);
26896
+ }, _marked9$2, null, [[0, 4]]);
26941
26897
  }
26942
26898
  function channelsForForwardLoadMore(action) {
26943
26899
  var payload, limit, _SceytChatClient4, channelQueryForward, channelsData, channelsToAdd, _yield$call4, mappedChannels, _t1;
@@ -26988,10 +26944,10 @@ function channelsForForwardLoadMore(action) {
26988
26944
  case 8:
26989
26945
  return _context1.a(2);
26990
26946
  }
26991
- }, _marked9$2, null, [[0, 7]]);
26947
+ }, _marked0$2, null, [[0, 7]]);
26992
26948
  }
26993
26949
  function markMessagesRead(action) {
26994
- var payload, channelId, messageIds, requestedMessageIds, _confirmation$message, channel, optimisticUpdate, pendingRead, confirmation, queuedPendingRead, _queuedPendingRead, readMessageIds, _iterator6, _step6, _confirmation$message2, _confirmation$message3, messageId, updateParams, _t10;
26950
+ var payload, channelId, messageIds, requestedMessageIds, _confirmation$message, channel, optimisticUpdate, pendingRead, confirmation, queuedPendingRead, _queuedPendingRead, readMessageIds, _iterator6, _step6, _confirmation$message2, _confirmation$message3, messageId, updateParams;
26995
26951
  return _regenerator().w(function (_context10) {
26996
26952
  while (1) switch (_context10.p = _context10.n) {
26997
26953
  case 0:
@@ -27002,21 +26958,9 @@ function markMessagesRead(action) {
27002
26958
  _context10.n = 1;
27003
26959
  break;
27004
26960
  }
27005
- log.warn('[READ_MESSAGE] Skipping read marker because message id list is empty', compactReadMessageLogData({
27006
- source: 'initial',
27007
- channelId: channelId,
27008
- readAll: false,
27009
- messageIds: messageIds
27010
- }));
27011
26961
  return _context10.a(2);
27012
26962
  case 1:
27013
26963
  _context10.p = 1;
27014
- log.info('[READ_MESSAGE] Received markMessagesRead action', compactReadMessageLogData({
27015
- source: 'initial',
27016
- channelId: channelId,
27017
- readAll: false,
27018
- messageIds: requestedMessageIds
27019
- }));
27020
26964
  _context10.n = 2;
27021
26965
  return effects.call(getStoredChannel$2, channelId);
27022
26966
  case 2:
@@ -27025,10 +26969,6 @@ function markMessagesRead(action) {
27025
26969
  _context10.n = 3;
27026
26970
  break;
27027
26971
  }
27028
- log.warn('[READ_MESSAGE] Cannot mark messages as read because channel was not found', compactReadMessageLogData({
27029
- channelId: channelId,
27030
- messageIds: requestedMessageIds
27031
- }));
27032
26972
  return _context10.a(2);
27033
26973
  case 3:
27034
26974
  optimisticUpdate = deriveChannelReadProgressUpdate({
@@ -27043,7 +26983,7 @@ function markMessagesRead(action) {
27043
26983
  messageIds: requestedMessageIds
27044
26984
  });
27045
26985
  _context10.n = 5;
27046
- return effects.call(confirmDisplayedRead, channel, pendingRead, 'initial');
26986
+ return effects.call(confirmDisplayedRead, channel, pendingRead);
27047
26987
  case 5:
27048
26988
  confirmation = _context10.v;
27049
26989
  if (!(confirmation.status === 'success')) {
@@ -27070,13 +27010,6 @@ function markMessagesRead(action) {
27070
27010
  return _context10.a(2);
27071
27011
  case 8:
27072
27012
  readMessageIds = getUniqueMessageIds(((_confirmation$message = confirmation.messageListMarker) === null || _confirmation$message === void 0 ? void 0 : _confirmation$message.messageIds) || requestedMessageIds);
27073
- log.info('[READ_MESSAGE] Confirmed read marker', compactReadMessageLogData({
27074
- source: 'initial',
27075
- channelId: channel.id,
27076
- readAll: false,
27077
- requestedMessageIds: requestedMessageIds,
27078
- confirmedMessageIds: readMessageIds
27079
- }));
27080
27013
  _iterator6 = _createForOfIteratorHelperLoose(readMessageIds);
27081
27014
  case 9:
27082
27015
  if ((_step6 = _iterator6()).done) {
@@ -27108,12 +27041,10 @@ function markMessagesRead(action) {
27108
27041
  break;
27109
27042
  case 13:
27110
27043
  _context10.p = 13;
27111
- _t10 = _context10.v;
27112
- log.error(_t10, '[READ_MESSAGE] Error on mark messages read');
27113
27044
  case 14:
27114
27045
  return _context10.a(2);
27115
27046
  }
27116
- }, _marked0$2, null, [[1, 13]]);
27047
+ }, _marked1$1, null, [[1, 13]]);
27117
27048
  }
27118
27049
  function markVoiceMessageAsPlayed(action) {
27119
27050
  var payload, channelId, messageIds, connectionStatus, channel, messageListMarker, _iterator7, _step7, messageId, updateParams, _t11;
@@ -27184,7 +27115,7 @@ function markVoiceMessageAsPlayed(action) {
27184
27115
  case 9:
27185
27116
  return _context11.a(2);
27186
27117
  }
27187
- }, _marked1$1, null, [[1, 8]]);
27118
+ }, _marked10$1, null, [[1, 8]]);
27188
27119
  }
27189
27120
  function updateMessageAsOpened(action) {
27190
27121
  var payload, channelId, messageListMarker, connectionStatus, channel, _iterator8, _step8, messageId, updateParams;
@@ -27243,7 +27174,7 @@ function updateMessageAsOpened(action) {
27243
27174
  case 6:
27244
27175
  return _context12.a(2);
27245
27176
  }
27246
- }, _marked10$1);
27177
+ }, _marked11$1);
27247
27178
  }
27248
27179
  function markMessageAsOpened(action) {
27249
27180
  var payload, channelId, messageIds, shouldUpdateMessage, connectionStatus, channel, messageListMarker, _t12;
@@ -27294,7 +27225,7 @@ function markMessageAsOpened(action) {
27294
27225
  case 6:
27295
27226
  return _context13.a(2);
27296
27227
  }
27297
- }, _marked11$1, null, [[1, 5]]);
27228
+ }, _marked12$1, null, [[1, 5]]);
27298
27229
  }
27299
27230
  function markMessagesDelivered(action) {
27300
27231
  var payload, channelId, messageIds, connectionStatus, channel, messageListMarker, _iterator9, _step9, messageId, updateParams, _t13;
@@ -27365,7 +27296,7 @@ function markMessagesDelivered(action) {
27365
27296
  case 9:
27366
27297
  return _context14.a(2);
27367
27298
  }
27368
- }, _marked12$1, null, [[1, 8]]);
27299
+ }, _marked13$1, null, [[1, 8]]);
27369
27300
  }
27370
27301
  function switchChannel(action) {
27371
27302
  var payload, channel, updateActiveChannel, channelToSwitch, existingChannel, addChannel, _SceytChatClient5, fetchedChannel, channelFromMap, currentActiveChannel, _t14;
@@ -27461,7 +27392,7 @@ function switchChannel(action) {
27461
27392
  case 17:
27462
27393
  return _context15.a(2);
27463
27394
  }
27464
- }, _marked13$1, null, [[0, 16]]);
27395
+ }, _marked14$1, null, [[0, 16]]);
27465
27396
  }
27466
27397
  function notificationsTurnOff(action) {
27467
27398
  var expireTime, activeChannelId, channel, updatedChannel, _t15;
@@ -27501,7 +27432,7 @@ function notificationsTurnOff(action) {
27501
27432
  case 7:
27502
27433
  return _context16.a(2);
27503
27434
  }
27504
- }, _marked14$1, null, [[3, 6]]);
27435
+ }, _marked15$1, null, [[3, 6]]);
27505
27436
  }
27506
27437
  function notificationsTurnOn() {
27507
27438
  var activeChannelId, channel, updatedChannel, _t16;
@@ -27540,21 +27471,15 @@ function notificationsTurnOn() {
27540
27471
  case 7:
27541
27472
  return _context17.a(2);
27542
27473
  }
27543
- }, _marked15$1, null, [[3, 6]]);
27474
+ }, _marked16$1, null, [[3, 6]]);
27544
27475
  }
27545
27476
  function markChannelAsRead(action) {
27546
- var channelId, channel, optimisticUpdate, pendingRead, confirmation, queuedPendingRead, _queuedPendingRead2, _t17;
27477
+ var channelId, channel, optimisticUpdate, pendingRead, confirmation, queuedPendingRead, _queuedPendingRead2;
27547
27478
  return _regenerator().w(function (_context18) {
27548
27479
  while (1) switch (_context18.p = _context18.n) {
27549
27480
  case 0:
27550
27481
  _context18.p = 0;
27551
27482
  channelId = action.payload.channelId;
27552
- log.info('[READ_MESSAGE] Received markChannelAsRead action', compactReadMessageLogData({
27553
- source: 'initial',
27554
- channelId: channelId,
27555
- readAll: true,
27556
- messageIds: []
27557
- }));
27558
27483
  _context18.n = 1;
27559
27484
  return effects.call(getStoredChannel$2, channelId);
27560
27485
  case 1:
@@ -27563,9 +27488,6 @@ function markChannelAsRead(action) {
27563
27488
  _context18.n = 2;
27564
27489
  break;
27565
27490
  }
27566
- log.warn('[READ_MESSAGE] Cannot mark channel as read because channel was not found', compactReadMessageLogData({
27567
- channelId: channelId
27568
- }));
27569
27491
  return _context18.a(2);
27570
27492
  case 2:
27571
27493
  optimisticUpdate = deriveChannelReadProgressUpdate({
@@ -27580,7 +27502,7 @@ function markChannelAsRead(action) {
27580
27502
  readAll: true
27581
27503
  });
27582
27504
  _context18.n = 4;
27583
- return effects.call(confirmDisplayedRead, channel, pendingRead, 'initial');
27505
+ return effects.call(confirmDisplayedRead, channel, pendingRead);
27584
27506
  case 4:
27585
27507
  confirmation = _context18.v;
27586
27508
  if (!(confirmation.status === 'success')) {
@@ -27591,13 +27513,6 @@ function markChannelAsRead(action) {
27591
27513
  if ((queuedPendingRead === null || queuedPendingRead === void 0 ? void 0 : queuedPendingRead.queuedAt) === (pendingRead === null || pendingRead === void 0 ? void 0 : pendingRead.queuedAt)) {
27592
27514
  removePendingChannelRead(channel.id);
27593
27515
  }
27594
- log.info('[READ_MESSAGE] Confirmed read marker', compactReadMessageLogData({
27595
- source: 'initial',
27596
- channelId: channel.id,
27597
- readAll: true,
27598
- requestedMessageIds: [],
27599
- confirmedMessageIds: []
27600
- }));
27601
27516
  return _context18.a(2);
27602
27517
  case 5:
27603
27518
  if (confirmation.status === 'drop') {
@@ -27610,15 +27525,13 @@ function markChannelAsRead(action) {
27610
27525
  break;
27611
27526
  case 6:
27612
27527
  _context18.p = 6;
27613
- _t17 = _context18.v;
27614
- log.error(_t17, '[READ_MESSAGE] Error on mark channel as read');
27615
27528
  case 7:
27616
27529
  return _context18.a(2);
27617
27530
  }
27618
- }, _marked16$1, null, [[0, 6]]);
27531
+ }, _marked17$1, null, [[0, 6]]);
27619
27532
  }
27620
27533
  function resendPendingChannelReads(action) {
27621
- var connectionState, pendingReads, _iterator0, _step0, pendingRead, currentPendingRead, channel, confirmation, latestPendingRead, _confirmation$message4, readMessageIds, _iterator1, _step1, _confirmation$message5, _confirmation$message6, messageId, updateParams, _t18;
27534
+ var connectionState, pendingReads, _iterator0, _step0, pendingRead, currentPendingRead, channel, confirmation, latestPendingRead, _confirmation$message4, readMessageIds, _iterator1, _step1, _confirmation$message5, _confirmation$message6, messageId, updateParams;
27622
27535
  return _regenerator().w(function (_context19) {
27623
27536
  while (1) switch (_context19.p = _context19.n) {
27624
27537
  case 0:
@@ -27636,7 +27549,7 @@ function resendPendingChannelReads(action) {
27636
27549
  _iterator0 = _createForOfIteratorHelperLoose(pendingReads);
27637
27550
  case 2:
27638
27551
  if ((_step0 = _iterator0()).done) {
27639
- _context19.n = 16;
27552
+ _context19.n = 14;
27640
27553
  break;
27641
27554
  }
27642
27555
  pendingRead = _step0.value;
@@ -27651,20 +27564,14 @@ function resendPendingChannelReads(action) {
27651
27564
  _context19.n = 4;
27652
27565
  break;
27653
27566
  }
27654
- return _context19.a(3, 15);
27567
+ return _context19.a(3, 13);
27655
27568
  case 4:
27656
27569
  if (!(!pendingRead.readAll && !pendingRead.messageIds.length)) {
27657
27570
  _context19.n = 5;
27658
27571
  break;
27659
27572
  }
27660
- log.warn('[READ_MESSAGE] Dropping queued replay because it has no message ids', compactReadMessageLogData({
27661
- source: 'replay',
27662
- channelId: pendingRead.channelId,
27663
- readAll: pendingRead.readAll,
27664
- messageIds: pendingRead.messageIds
27665
- }));
27666
27573
  removePendingChannelRead(pendingRead.channelId);
27667
- return _context19.a(3, 15);
27574
+ return _context19.a(3, 13);
27668
27575
  case 5:
27669
27576
  _context19.n = 6;
27670
27577
  return effects.call(getStoredChannel$2, pendingRead.channelId);
@@ -27674,18 +27581,11 @@ function resendPendingChannelReads(action) {
27674
27581
  _context19.n = 7;
27675
27582
  break;
27676
27583
  }
27677
- log.warn('[READ_MESSAGE] Dropping queued replay because channel was not found', compactReadMessageLogData({
27678
- source: 'replay',
27679
- channelId: pendingRead.channelId,
27680
- readAll: pendingRead.readAll,
27681
- messageIds: pendingRead.messageIds
27682
- }));
27683
27584
  removePendingChannelRead(pendingRead.channelId);
27684
- return _context19.a(3, 15);
27585
+ return _context19.a(3, 13);
27685
27586
  case 7:
27686
- log.info('[READ_MESSAGE] Replaying queued read marker', compactReadMessageLogData(getReadMarkerLogContext(pendingRead, 'replay', pendingRead.messageIds)));
27687
27587
  _context19.n = 8;
27688
- return effects.call(confirmDisplayedRead, channel, pendingRead, 'replay');
27588
+ return effects.call(confirmDisplayedRead, channel, pendingRead);
27689
27589
  case 8:
27690
27590
  confirmation = _context19.v;
27691
27591
  latestPendingRead = getPendingChannelRead(pendingRead.channelId);
@@ -27693,23 +27593,16 @@ function resendPendingChannelReads(action) {
27693
27593
  _context19.n = 9;
27694
27594
  break;
27695
27595
  }
27696
- return _context19.a(3, 15);
27596
+ return _context19.a(3, 13);
27697
27597
  case 9:
27698
27598
  if (confirmation.status === 'success' || confirmation.status === 'drop') {
27699
27599
  removePendingChannelRead(pendingRead.channelId);
27700
27600
  }
27701
27601
  if (!(confirmation.status === 'success' && !pendingRead.readAll)) {
27702
- _context19.n = 14;
27602
+ _context19.n = 13;
27703
27603
  break;
27704
27604
  }
27705
27605
  readMessageIds = getUniqueMessageIds(((_confirmation$message4 = confirmation.messageListMarker) === null || _confirmation$message4 === void 0 ? void 0 : _confirmation$message4.messageIds) || pendingRead.messageIds);
27706
- log.info('[READ_MESSAGE] Confirmed read marker', compactReadMessageLogData({
27707
- source: 'replay',
27708
- channelId: channel.id,
27709
- readAll: false,
27710
- requestedMessageIds: pendingRead.messageIds,
27711
- confirmedMessageIds: readMessageIds
27712
- }));
27713
27606
  _iterator1 = _createForOfIteratorHelperLoose(readMessageIds);
27714
27607
  case 10:
27715
27608
  if ((_step1 = _iterator1()).done) {
@@ -27737,32 +27630,17 @@ function resendPendingChannelReads(action) {
27737
27630
  _context19.n = 10;
27738
27631
  break;
27739
27632
  case 13:
27740
- _context19.n = 15;
27633
+ _context19.n = 2;
27741
27634
  break;
27742
27635
  case 14:
27743
- if (confirmation.status === 'success' && pendingRead.readAll) {
27744
- log.info('[READ_MESSAGE] Confirmed read marker', compactReadMessageLogData({
27745
- source: 'replay',
27746
- channelId: channel.id,
27747
- readAll: true,
27748
- requestedMessageIds: [],
27749
- confirmedMessageIds: []
27750
- }));
27751
- }
27752
- case 15:
27753
- _context19.n = 2;
27636
+ _context19.n = 16;
27754
27637
  break;
27638
+ case 15:
27639
+ _context19.p = 15;
27755
27640
  case 16:
27756
- _context19.n = 18;
27757
- break;
27758
- case 17:
27759
- _context19.p = 17;
27760
- _t18 = _context19.v;
27761
- log.error(_t18, '[READ_MESSAGE] Error on resend pending channel reads');
27762
- case 18:
27763
27641
  return _context19.a(2);
27764
27642
  }
27765
- }, _marked17$1, null, [[0, 17]]);
27643
+ }, _marked18$1, null, [[0, 15]]);
27766
27644
  }
27767
27645
  function markChannelAsUnRead(action) {
27768
27646
  var channelId, channel, _t19;
@@ -27798,7 +27676,7 @@ function markChannelAsUnRead(action) {
27798
27676
  case 5:
27799
27677
  return _context20.a(2);
27800
27678
  }
27801
- }, _marked18$1, null, [[0, 4]]);
27679
+ }, _marked19$1, null, [[0, 4]]);
27802
27680
  }
27803
27681
  function pinChannel(action) {
27804
27682
  var channelId, channel, updatedChannel, _t20;
@@ -27835,7 +27713,7 @@ function pinChannel(action) {
27835
27713
  case 5:
27836
27714
  return _context21.a(2);
27837
27715
  }
27838
- }, _marked19$1, null, [[0, 4]]);
27716
+ }, _marked20$1, null, [[0, 4]]);
27839
27717
  }
27840
27718
  function unpinChannel(action) {
27841
27719
  var channelId, channel, updatedChannel, _t21;
@@ -27872,7 +27750,7 @@ function unpinChannel(action) {
27872
27750
  case 5:
27873
27751
  return _context22.a(2);
27874
27752
  }
27875
- }, _marked20$1, null, [[0, 4]]);
27753
+ }, _marked21$1, null, [[0, 4]]);
27876
27754
  }
27877
27755
  function removeChannelCaches(action) {
27878
27756
  var payload, channelId, activeChannelId, activeChannel;
@@ -27907,7 +27785,7 @@ function removeChannelCaches(action) {
27907
27785
  case 4:
27908
27786
  return _context23.a(2);
27909
27787
  }
27910
- }, _marked21$1);
27788
+ }, _marked22$1);
27911
27789
  }
27912
27790
  function leaveChannel(action) {
27913
27791
  var payload, channelId, channel, messageBuilder, messageToSend, _t22;
@@ -27966,7 +27844,7 @@ function leaveChannel(action) {
27966
27844
  case 8:
27967
27845
  return _context24.a(2);
27968
27846
  }
27969
- }, _marked22$1, null, [[0, 7]]);
27847
+ }, _marked23$1, null, [[0, 7]]);
27970
27848
  }
27971
27849
  function deletePendingDeleteChannels() {
27972
27850
  var pendingDeleteChannels, _iterator10, _step10, channel, resendableError, _t23;
@@ -28010,7 +27888,7 @@ function deletePendingDeleteChannels() {
28010
27888
  case 9:
28011
27889
  return _context25.a(2);
28012
27890
  }
28013
- }, _marked23$1, null, [[2, 7]]);
27891
+ }, _marked24$1, null, [[2, 7]]);
28014
27892
  }
28015
27893
  function deleteChannel(action) {
28016
27894
  var payload, channelId, channel, activeChannelId, lastChannel, _t24;
@@ -28104,7 +27982,7 @@ function deleteChannel(action) {
28104
27982
  case 19:
28105
27983
  return _context26.a(2);
28106
27984
  }
28107
- }, _marked24$1, null, [[0, 18]]);
27985
+ }, _marked25$1, null, [[0, 18]]);
28108
27986
  }
28109
27987
  function blockChannel(action) {
28110
27988
  var payload, channelId, channel, _t25;
@@ -28143,7 +28021,7 @@ function blockChannel(action) {
28143
28021
  case 6:
28144
28022
  return _context27.a(2);
28145
28023
  }
28146
- }, _marked25$1, null, [[0, 5]]);
28024
+ }, _marked26$1, null, [[0, 5]]);
28147
28025
  }
28148
28026
  function updateChannel(action) {
28149
28027
  var payload, channelId, config, _SceytChatClient6, channel, paramsToUpdate, fileToUpload, _yield$call5, subject, avatarUrl, metadata, onUpdateChannel, _channel3, _channel4, _channel5, fields, updatedChannel, _t26;
@@ -28240,7 +28118,7 @@ function updateChannel(action) {
28240
28118
  case 9:
28241
28119
  return _context28.a(2);
28242
28120
  }
28243
- }, _marked26$1, null, [[0, 8]]);
28121
+ }, _marked27$1, null, [[0, 8]]);
28244
28122
  }
28245
28123
  function checkUsersStatus() {
28246
28124
  var _SceytChatClient7, usersForUpdate, updatedUsers, usersToUpdateMap, update, updateData, _t27;
@@ -28291,7 +28169,7 @@ function checkUsersStatus() {
28291
28169
  case 7:
28292
28170
  return _context29.a(2);
28293
28171
  }
28294
- }, _marked27$1, null, [[0, 6]]);
28172
+ }, _marked28$1, null, [[0, 6]]);
28295
28173
  }
28296
28174
  function sendTyping(action) {
28297
28175
  var state, activeChannelId, channel, _t28;
@@ -28334,7 +28212,7 @@ function sendTyping(action) {
28334
28212
  case 8:
28335
28213
  return _context30.a(2);
28336
28214
  }
28337
- }, _marked28$1, null, [[3, 7]]);
28215
+ }, _marked29$1, null, [[3, 7]]);
28338
28216
  }
28339
28217
  function sendRecording(action) {
28340
28218
  var _action$payload, state, channelId, channel, _t29;
@@ -28377,7 +28255,7 @@ function sendRecording(action) {
28377
28255
  case 7:
28378
28256
  return _context31.a(2);
28379
28257
  }
28380
- }, _marked29$1, null, [[2, 6]]);
28258
+ }, _marked30$1, null, [[2, 6]]);
28381
28259
  }
28382
28260
  function clearHistory(action) {
28383
28261
  var payload, channelId, channel, activeChannelId, groupName, _t30;
@@ -28447,7 +28325,7 @@ function clearHistory(action) {
28447
28325
  case 10:
28448
28326
  return _context32.a(2);
28449
28327
  }
28450
- }, _marked30$1, null, [[0, 9]]);
28328
+ }, _marked31$1, null, [[0, 9]]);
28451
28329
  }
28452
28330
  function deleteAllMessages(action) {
28453
28331
  var payload, channelId, channel, activeChannelId, groupName, _t31;
@@ -28520,7 +28398,7 @@ function deleteAllMessages(action) {
28520
28398
  case 11:
28521
28399
  return _context33.a(2);
28522
28400
  }
28523
- }, _marked31$1, null, [[0, 10]]);
28401
+ }, _marked32$1, null, [[0, 10]]);
28524
28402
  }
28525
28403
  function joinChannel(action) {
28526
28404
  var payload, channelId, _SceytChatClient8, channel, joinedChannel, _t32;
@@ -28573,7 +28451,7 @@ function joinChannel(action) {
28573
28451
  case 10:
28574
28452
  return _context34.a(2);
28575
28453
  }
28576
- }, _marked32$1, null, [[0, 9]]);
28454
+ }, _marked33$1, null, [[0, 9]]);
28577
28455
  }
28578
28456
  function watchForChannelEvents() {
28579
28457
  return _regenerator().w(function (_context35) {
@@ -28584,7 +28462,7 @@ function watchForChannelEvents() {
28584
28462
  case 1:
28585
28463
  return _context35.a(2);
28586
28464
  }
28587
- }, _marked33$1);
28465
+ }, _marked34$1);
28588
28466
  }
28589
28467
  function createChannelInviteKey(action) {
28590
28468
  var payload, channelId, _SceytChatClient9, channel, inviteKey, _t33;
@@ -28626,7 +28504,7 @@ function createChannelInviteKey(action) {
28626
28504
  case 5:
28627
28505
  return _context36.a(2);
28628
28506
  }
28629
- }, _marked34$1, null, [[0, 4]]);
28507
+ }, _marked35$1, null, [[0, 4]]);
28630
28508
  }
28631
28509
  function getChannelInviteKeys(action) {
28632
28510
  var payload, channelId, channel, inviteKeys, _t34;
@@ -28663,7 +28541,7 @@ function getChannelInviteKeys(action) {
28663
28541
  case 5:
28664
28542
  return _context37.a(2);
28665
28543
  }
28666
- }, _marked35$1, null, [[0, 4]]);
28544
+ }, _marked36$1, null, [[0, 4]]);
28667
28545
  }
28668
28546
  function regenerateChannelInviteKey(action) {
28669
28547
  var payload, channelId, key, deletePermanently, channel, inviteKey, _t35;
@@ -28704,7 +28582,7 @@ function regenerateChannelInviteKey(action) {
28704
28582
  case 5:
28705
28583
  return _context38.a(2);
28706
28584
  }
28707
- }, _marked36$1, null, [[0, 4]]);
28585
+ }, _marked37$1, null, [[0, 4]]);
28708
28586
  }
28709
28587
  function updateChannelInviteKey(action) {
28710
28588
  var channelInviteKeys, channelId, payload, payloadChannelId, key, accessPriorHistory, expiresAt, maxUses, channel, copiedChannelInviteKeys, _t36;
@@ -28764,7 +28642,7 @@ function updateChannelInviteKey(action) {
28764
28642
  case 6:
28765
28643
  return _context39.a(2);
28766
28644
  }
28767
- }, _marked37$1, null, [[1, 5]]);
28645
+ }, _marked38$1, null, [[1, 5]]);
28768
28646
  }
28769
28647
  function getChannelByInviteKey(action) {
28770
28648
  var _channel$, _channel$2, payload, key, _SceytChatClient0, channel, _t37;
@@ -28815,7 +28693,7 @@ function getChannelByInviteKey(action) {
28815
28693
  case 8:
28816
28694
  return _context40.a(2);
28817
28695
  }
28818
- }, _marked38$1, null, [[0, 6]]);
28696
+ }, _marked39$1, null, [[0, 6]]);
28819
28697
  }
28820
28698
  function joinChannelWithInviteKey(action) {
28821
28699
  var payload, key, _SceytChatClient1, user, channel, messageToSend, _t38;
@@ -28859,7 +28737,7 @@ function joinChannelWithInviteKey(action) {
28859
28737
  case 7:
28860
28738
  return _context41.a(2);
28861
28739
  }
28862
- }, _marked39$1, null, [[0, 6]]);
28740
+ }, _marked40$1, null, [[0, 6]]);
28863
28741
  }
28864
28742
  function setMessageRetentionPeriod(action) {
28865
28743
  var payload, channelId, periodInMilliseconds, channel, messageToSend, _t39;
@@ -28912,7 +28790,7 @@ function setMessageRetentionPeriod(action) {
28912
28790
  case 6:
28913
28791
  return _context42.a(2);
28914
28792
  }
28915
- }, _marked40$1, null, [[0, 5]]);
28793
+ }, _marked41$1, null, [[0, 5]]);
28916
28794
  }
28917
28795
  function getChannelsWithUser(action) {
28918
28796
  var payload, userId, _SceytChatClient10, channelsQueryBuilder, channelsQuery, channelsData, channels, _t40;
@@ -28975,7 +28853,7 @@ function getChannelsWithUser(action) {
28975
28853
  case 12:
28976
28854
  return _context43.a(2);
28977
28855
  }
28978
- }, _marked41$1, null, [[2, 9, 10, 12]]);
28856
+ }, _marked42$1, null, [[2, 9, 10, 12]]);
28979
28857
  }
28980
28858
  function loadMoreMutualChannels(action) {
28981
28859
  var payload, limit, mutualChannelsQuery, channelsData, _t41;
@@ -29033,7 +28911,7 @@ function loadMoreMutualChannels(action) {
29033
28911
  case 11:
29034
28912
  return _context44.a(2);
29035
28913
  }
29036
- }, _marked42$1, null, [[1, 8, 9, 11]]);
28914
+ }, _marked43$1, null, [[1, 8, 9, 11]]);
29037
28915
  }
29038
28916
  function ChannelsSaga() {
29039
28917
  return _regenerator().w(function (_context45) {
@@ -29167,7 +29045,7 @@ function ChannelsSaga() {
29167
29045
  case 42:
29168
29046
  return _context45.a(2);
29169
29047
  }
29170
- }, _marked43$1);
29048
+ }, _marked44$1);
29171
29049
  }
29172
29050
 
29173
29051
  var _marked$4 = /*#__PURE__*/_regenerator().m(getMembers),
@@ -39918,6 +39796,10 @@ var Attachment = function Attachment(_ref) {
39918
39796
  var _useState3 = React.useState(attachmentUrlFromMap),
39919
39797
  attachmentUrl = _useState3[0],
39920
39798
  setAttachmentUrl = _useState3[1];
39799
+ var attachmentIdentity = attachment.id || attachment.tid || 'unknown-attachment';
39800
+ var attachmentKey = (channelId || 'unknown-channel') + ":" + attachmentIdentity + ":" + (attachment.url || '');
39801
+ var currentAttachmentKeyRef = React.useRef(attachmentKey);
39802
+ currentAttachmentKeyRef.current = attachmentKey;
39921
39803
  var _useState4 = React.useState(false),
39922
39804
  imageLoaded = _useState4[0],
39923
39805
  setImageLoaded = _useState4[1];
@@ -39977,6 +39859,18 @@ var Attachment = function Attachment(_ref) {
39977
39859
  log.error('error on get attachmentThumb', e);
39978
39860
  }
39979
39861
  }
39862
+ React.useEffect(function () {
39863
+ if (attachment.type !== attachmentTypes.image) return;
39864
+ log.info('[MEDIA_ISSUE] image thumbnail source', JSON.stringify({
39865
+ channelId: channelId || null,
39866
+ attachmentId: attachment.id || attachment.tid || null,
39867
+ attachmentUrl: attachment.url || null,
39868
+ mapUrl: attachmentUrlFromMap || null,
39869
+ propUrl: attachment.attachmentUrl || null,
39870
+ localUrl: attachmentUrl || null,
39871
+ renderedSource: attachmentUrlFromMap || attachment.attachmentUrl || attachmentUrl || attachmentThumb || null
39872
+ }));
39873
+ }, [attachment.id, attachment.tid, attachment.type, attachment.url, attachment.attachmentUrl, attachmentUrlFromMap, attachmentUrl, channelId]);
39980
39874
  React.useEffect(function () {
39981
39875
  var currentSrc = attachment.attachmentUrl || attachmentUrlFromMap || attachmentUrl || attachmentThumb;
39982
39876
  var wasThumbnail = previousImageSrcRef.current === attachmentThumb;
@@ -40266,12 +40160,23 @@ var Attachment = function Attachment(_ref) {
40266
40160
  }, [attachmentUrl]);
40267
40161
  React.useEffect(function () {
40268
40162
  if (!attachment.attachmentUrl && connectionStatus === CONNECTION_STATUS.CONNECTED && attachment.id && !attachmentUrlFromMap && !(attachment.type === attachmentTypes.file || attachment.type === attachmentTypes.link)) {
40163
+ var requestAttachmentKey = attachmentKey;
40164
+ log.info('[MEDIA_ISSUE] image thumbnail load started', JSON.stringify({
40165
+ channelId: channelId || null,
40166
+ attachmentId: attachment.id || attachment.tid || null,
40167
+ url: attachment.url
40168
+ }));
40269
40169
  getAttachmentUrlFromCache(attachment.url).then(function (cachedUrl) {
40270
40170
  try {
40271
40171
  var _temp16 = function () {
40272
40172
  if (attachment.type === attachmentTypes.image && !isPreview) {
40273
40173
  var _temp15 = function () {
40274
40174
  if (cachedUrl) {
40175
+ log.info('[MEDIA_ISSUE] image thumbnail cache resolved', JSON.stringify({
40176
+ requestAttachmentKey: requestAttachmentKey,
40177
+ currentAttachmentKey: currentAttachmentKeyRef.current,
40178
+ cachedUrl: cachedUrl
40179
+ }));
40275
40180
  setAttachmentUrl(cachedUrl);
40276
40181
  dispatch(setUpdateMessageAttachmentAC(attachment.url, cachedUrl));
40277
40182
  setIsCached(true);
@@ -40292,6 +40197,12 @@ var Attachment = function Attachment(_ref) {
40292
40197
  try {
40293
40198
  return Promise.resolve(compressAndCacheImage(url, attachment.url, renderWidth, renderHeight)).then(function (compressedUrl) {
40294
40199
  if (compressedUrl) {
40200
+ log.info('[MEDIA_ISSUE] image thumbnail download resolved', JSON.stringify({
40201
+ requestAttachmentKey: requestAttachmentKey,
40202
+ currentAttachmentKey: currentAttachmentKeyRef.current,
40203
+ sourceUrl: url,
40204
+ cachedUrl: compressedUrl
40205
+ }));
40295
40206
  setAttachmentUrl(compressedUrl);
40296
40207
  }
40297
40208
  downloadImage(compressedUrl || url);
@@ -45358,48 +45269,10 @@ var Message$1 = function Message(_ref) {
45358
45269
  return marker.name === MESSAGE_DELIVERY_STATUS.READ;
45359
45270
  }));
45360
45271
  var shouldSendReadMarker = isVisible && message.incoming && !alreadyRead && !disableAutoReadTracking && isTabActive && !!channel.newMessageCount && channel.newMessageCount > 0 && connectionStatus === CONNECTION_STATUS.CONNECTED;
45361
- if (message.incoming && isVisible) {
45362
- if (shouldSendReadMarker) {
45363
- log.info('[READ_MESSAGE] Message auto-read gate passed', compactReadMessageLogData({
45364
- source: 'message',
45365
- channelId: channel.id,
45366
- messageId: message.id,
45367
- isVisible: isVisible,
45368
- alreadyRead: alreadyRead,
45369
- disableAutoReadTracking: disableAutoReadTracking,
45370
- isTabActive: isTabActive,
45371
- newMessageCount: channel.newMessageCount || 0,
45372
- connectionStatus: connectionStatus,
45373
- queued: !!queueReadMarker
45374
- }));
45375
- } else {
45376
- log.info('[READ_MESSAGE] Message auto-read gate blocked', compactReadMessageLogData({
45377
- source: 'message',
45378
- channelId: channel.id,
45379
- messageId: message.id,
45380
- isVisible: isVisible,
45381
- alreadyRead: alreadyRead,
45382
- disableAutoReadTracking: disableAutoReadTracking,
45383
- isTabActive: isTabActive,
45384
- newMessageCount: channel.newMessageCount || 0,
45385
- connectionStatus: connectionStatus
45386
- }));
45387
- }
45388
- }
45389
45272
  if (shouldSendReadMarker) {
45390
45273
  if (queueReadMarker) {
45391
- log.info('[READ_MESSAGE] Queueing read marker from Message component', compactReadMessageLogData({
45392
- source: 'message',
45393
- channelId: channel.id,
45394
- messageId: message.id
45395
- }));
45396
45274
  queueReadMarker(channel.id, message.id);
45397
45275
  } else {
45398
- log.info('[READ_MESSAGE] Dispatching read marker directly from Message component', compactReadMessageLogData({
45399
- source: 'message',
45400
- channelId: channel.id,
45401
- messageId: message.id
45402
- }));
45403
45276
  dispatch(markMessagesAsReadAC(channel.id, [message.id]));
45404
45277
  }
45405
45278
  }
@@ -45442,14 +45315,6 @@ var Message$1 = function Message(_ref) {
45442
45315
  }, [dispatch, selectionIsActive]);
45443
45316
  React.useEffect(function () {
45444
45317
  if (isVisible) {
45445
- if (message.incoming) {
45446
- log.info('[READ_MESSAGE] Message row became visible', compactReadMessageLogData({
45447
- source: 'message',
45448
- channelId: channel.id,
45449
- messageId: message.id,
45450
- localRef: message.tid || message.id || ''
45451
- }));
45452
- }
45453
45318
  if (setLastVisibleMessageId) {
45454
45319
  setLastVisibleMessageId(message);
45455
45320
  }
@@ -46460,14 +46325,6 @@ function useChatController(_ref5) {
46460
46325
  }, [clearJumpScrollingLock]);
46461
46326
  var queueVisibleUnreadCheck = React.useCallback(function () {
46462
46327
  if (pendingVisibleUnreadFrameRef.current !== null || unreadScrollTo || !tabIsActive) {
46463
- if (!tabIsActive) {
46464
- log.info('[READ_MESSAGE] Visible unread scan skipped because tab is inactive', compactReadMessageLogData({
46465
- source: 'controller',
46466
- channelId: channel.id,
46467
- unreadScrollTo: unreadScrollTo,
46468
- pendingFrameScheduled: pendingVisibleUnreadFrameRef.current !== null
46469
- }));
46470
- }
46471
46328
  return;
46472
46329
  }
46473
46330
  pendingVisibleUnreadFrameRef.current = requestAnimationFrame(function () {
@@ -46502,35 +46359,13 @@ function useChatController(_ref5) {
46502
46359
  var ids = visibleUnreadMessages.filter(isUnreadIncomingMessage).map(function (message) {
46503
46360
  return message.id;
46504
46361
  });
46505
- if (visibleUnreadMessages.length && !ids.length) {
46506
- log.info('[READ_MESSAGE] Visible unread scan found messages, but none were unread incoming', compactReadMessageLogData({
46507
- source: 'controller',
46508
- channelId: channel.id,
46509
- visibleCandidateIds: visibleUnreadMessages.map(function (message) {
46510
- return message.id;
46511
- })
46512
- }));
46513
- }
46514
46362
  if (!ids.length || !channel.id || !channel.newMessageCount) {
46515
- if (ids.length && (!channel.id || !channel.newMessageCount)) {
46516
- log.info('[READ_MESSAGE] Visible unread scan blocked before dispatch', compactReadMessageLogData({
46517
- source: 'controller',
46518
- channelId: channel.id,
46519
- messageIds: ids,
46520
- newMessageCount: channel.newMessageCount || 0
46521
- }));
46522
- }
46523
46363
  return;
46524
46364
  }
46525
46365
  ids.forEach(function (id) {
46526
46366
  visibleUnreadReportedRef.current.add(id);
46527
46367
  });
46528
46368
  registerLocallyReadUnreadMessages(ids.length);
46529
- log.info('[READ_MESSAGE] Dispatching read marker from visible unread scan', compactReadMessageLogData({
46530
- source: 'controller',
46531
- channelId: channel.id,
46532
- messageIds: ids
46533
- }));
46534
46369
  dispatch(markMessagesAsReadAC(channel.id, ids));
46535
46370
  });
46536
46371
  }, [channel.id, channel.lastDisplayedMessageId, channel.newMessageCount, dispatch, hasNext, messages, registerLocallyReadUnreadMessages, unreadScrollTo, tabIsActive]);
@@ -53999,6 +53834,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
53999
53834
  return;
54000
53835
  }
54001
53836
  if (messageToEdit) {
53837
+ var _getDraftMessageFromM;
54002
53838
  var persistedEditText = editMessageText || messageToEdit.body || '';
54003
53839
  var normalizeAttrs = function normalizeAttrs(attrs) {
54004
53840
  return !attrs || attrs.length === 0 ? [] : attrs;
@@ -54007,13 +53843,18 @@ var SendMessageInput = function SendMessageInput(_ref3) {
54007
53843
  var hasAttributesChanged = !compareMessageBodyAttributes(normalizeAttrs(messageBodyAttributes), normalizeAttrs(messageToEdit.bodyAttributes));
54008
53844
  var canSubmitEdit = !!editMessageText.trim() && (hasTextChanged || hasAttributesChanged);
54009
53845
  setSendMessageIsActive(canSubmitEdit);
54010
- setDraftMessageToMap(activeChannel.id, {
54011
- text: persistedEditText || 'Edit message',
54012
- mentionedUsers: mentionedUsers,
54013
- messageToEdit: messageToEdit,
54014
- editMessageText: persistedEditText,
54015
- editBodyAttributes: messageBodyAttributes
54016
- });
53846
+ if (canSubmitEdit) {
53847
+ setDraftMessageToMap(activeChannel.id, {
53848
+ text: persistedEditText,
53849
+ mentionedUsers: mentionedUsers,
53850
+ messageToEdit: messageToEdit,
53851
+ editMessageText: persistedEditText,
53852
+ editBodyAttributes: messageBodyAttributes
53853
+ });
53854
+ } else if ((_getDraftMessageFromM = getDraftMessageFromMap(activeChannel.id)) !== null && _getDraftMessageFromM !== void 0 && _getDraftMessageFromM.messageToEdit) {
53855
+ removeDraftMessageFromMap(activeChannel.id);
53856
+ dispatch(setChannelDraftMessageIsRemovedAC(activeChannel.id));
53857
+ }
54017
53858
  return;
54018
53859
  }
54019
53860
  if (messageText.trim() || editMessageText !== null && editMessageText !== void 0 && editMessageText.trim() && editMessageText && (editMessageText === null || editMessageText === void 0 ? void 0 : editMessageText.trim()) !== (messageToEdit === null || messageToEdit === void 0 ? void 0 : messageToEdit.body) || attachments.length) {
@@ -54056,15 +53897,6 @@ var SendMessageInput = function SendMessageInput(_ref3) {
54056
53897
  setListenerIsAdded(true);
54057
53898
  document.body.setAttribute('onbeforeunload', "return () => 'reload?'");
54058
53899
  }
54059
- } else if (messageForReply || draftMessage !== null && draftMessage !== void 0 && draftMessage.messageForReply) {
54060
- setDraftMessageToMap(activeChannel.id, {
54061
- text: '',
54062
- mentionedUsers: (draftMessage === null || draftMessage === void 0 ? void 0 : draftMessage.mentionedUsers) || mentionedUsers,
54063
- messageForReply: messageForReply || (draftMessage === null || draftMessage === void 0 ? void 0 : draftMessage.messageForReply),
54064
- bodyAttributes: messageBodyAttributes,
54065
- attachments: [],
54066
- viewOnce: false
54067
- });
54068
53900
  } else if (draftMessage) {
54069
53901
  if (restoredDraftChannelIdRef.current && restoredDraftChannelIdRef.current !== activeChannel.id) {
54070
53902
  return;
@@ -54134,18 +53966,16 @@ var SendMessageInput = function SendMessageInput(_ref3) {
54134
53966
  }
54135
53967
  });
54136
53968
  useDidUpdate(function () {
54137
- var _draftMessagesMap$act;
54138
- var persistedReply = (_draftMessagesMap$act = draftMessagesMap[activeChannel.id]) === null || _draftMessagesMap$act === void 0 ? void 0 : _draftMessagesMap$act.messageForReply;
54139
53969
  if (isNavigatingChannelRef.current) {
54140
53970
  isNavigatingChannelRef.current = false;
54141
53971
  return;
54142
53972
  }
54143
- var hasDraftContent = !!(messageText.trim() || attachments.length || messageForReply || persistedReply);
53973
+ var hasDraftContent = !!(messageText.trim() || attachments.length);
54144
53974
  if (hasDraftContent) {
54145
53975
  setDraftMessageToMap(activeChannel.id, {
54146
53976
  text: messageText,
54147
53977
  mentionedUsers: mentionedUsers,
54148
- messageForReply: messageForReply || persistedReply,
53978
+ messageForReply: messageForReply,
54149
53979
  bodyAttributes: messageBodyAttributes,
54150
53980
  attachments: attachments,
54151
53981
  viewOnce: viewOnce