diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js --- a/lib/reducers/message-reducer.js +++ b/lib/reducers/message-reducer.js @@ -1391,7 +1391,11 @@ }; } reduxMessageIDsToPrune.push(...removed); - if (!newThreadInfos[threadID]?.thick) { + const threadType = newThreadInfos[threadID]?.type; + if ( + threadType && + threadSpecs[threadType].protocol.messagesStoredOnServer + ) { dbMessageIDsToPrune.push(...removed); } diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js --- a/lib/reducers/thread-reducer.js +++ b/lib/reducers/thread-reducer.js @@ -350,7 +350,7 @@ continue; } - if (threadInfo.thick) { + if (threadInfo.timestamps) { if (threadInfo.timestamps.currentUser.unread > mostRecentTime) { continue; } diff --git a/lib/shared/dm-ops/delete-entry-spec.js b/lib/shared/dm-ops/delete-entry-spec.js --- a/lib/shared/dm-ops/delete-entry-spec.js +++ b/lib/shared/dm-ops/delete-entry-spec.js @@ -56,7 +56,10 @@ const { rawMessageInfo } = messageDataWithMessageInfos; const rawMessageInfos = [rawMessageInfo]; - invariant(rawEntryInfo?.thick, 'Entry thread should be thick'); + invariant( + rawEntryInfo?.lastUpdatedTime, + 'Entry should have lastUpdatedTime', + ); const timestamp = rawEntryInfo.lastUpdatedTime; const notificationsCreationData = { diff --git a/lib/shared/dm-ops/dm-op-utils.js b/lib/shared/dm-ops/dm-op-utils.js --- a/lib/shared/dm-ops/dm-op-utils.js +++ b/lib/shared/dm-ops/dm-op-utils.js @@ -410,7 +410,7 @@ const time = Math.max( messagesAffectingUnreadStatus.map(message => message.time), ); - invariant(threadInfo.thick, 'Thread should be thick'); + invariant(threadInfo.timestamps, 'Thread should have timestamps'); if (threadInfo.timestamps.currentUser.unread < time) { newUpdateInfos.push({ diff --git a/lib/shared/dm-ops/edit-entry-spec.js b/lib/shared/dm-ops/edit-entry-spec.js --- a/lib/shared/dm-ops/edit-entry-spec.js +++ b/lib/shared/dm-ops/edit-entry-spec.js @@ -57,7 +57,10 @@ const { rawMessageInfo } = messageDataWithMessageInfos; const rawMessageInfos = [rawMessageInfo]; - invariant(rawEntryInfo?.thick, 'Entry should be thick'); + invariant( + rawEntryInfo?.lastUpdatedTime, + 'Entry should have lastUpdatedTime', + ); const timestamp = rawEntryInfo.lastUpdatedTime; const notificationsCreationData = { diff --git a/lib/shared/updates/update-thread-read-status-spec.js b/lib/shared/updates/update-thread-read-status-spec.js --- a/lib/shared/updates/update-thread-read-status-spec.js +++ b/lib/shared/updates/update-thread-read-status-spec.js @@ -34,7 +34,7 @@ const storeThreadInfo = storeThreadInfos[update.threadID]; let updatedThread; - if (storeThreadInfo.thick) { + if (storeThreadInfo.timestamps) { updatedThread = { ...storeThreadInfo, currentUser: { diff --git a/web/modals/history/history-modal.react.js b/web/modals/history/history-modal.react.js --- a/web/modals/history/history-modal.react.js +++ b/web/modals/history/history-modal.react.js @@ -18,6 +18,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import { nonExcludeDeletedCalendarFiltersSelector } from 'lib/selectors/calendar-filter-selectors.js'; import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; +import { threadSpecs } from 'lib/shared/threads/thread-specs.js'; import type { EntryInfo, CalendarQuery, @@ -117,10 +118,13 @@ const threadInfos = this.props.threadInfos; if (entryInfos) { entries = _flow( - _filter( - (entryInfo: EntryInfo) => - entryInfo.id && !threadInfos?.[entryInfo.threadID].thick, - ), + _filter((entryInfo: EntryInfo) => { + const threadType = threadInfos?.[entryInfo.threadID].type; + const supportsCalendarHistory = + !threadType || + threadSpecs[threadType].protocol.supportsCalendarHistory; + return entryInfo.id && supportsCalendarHistory; + }), _map((entryInfo: EntryInfo) => { const serverID = entryInfo.id; invariant(serverID, 'serverID should be set');