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 @@ -92,7 +92,6 @@ fullStateSyncActionType, incrementalStateSyncActionType, } from '../types/socket-types.js'; -import { updateThreadLastNavigatedActionType } from '../types/thread-activity-types.js'; import { threadPermissions } from '../types/thread-permission-types.js'; import { type RawThreadInfo } from '../types/thread-types.js'; import { @@ -156,8 +155,6 @@ const newThread = () => ({ messageIDs: [], startReached: false, - lastNavigatedTo: 0, - lastPruned: Date.now(), }); type FreshMessageStoreResult = { @@ -518,8 +515,6 @@ updatedThreads[threadID] = { messageIDs, startReached: false, - lastNavigatedTo: oldThread.lastNavigatedTo, - lastPruned: oldThread.lastPruned, }; return updatedThreads[threadID]; } @@ -543,8 +538,6 @@ updatedThreads[threadID] = { messageIDs: oldMessageIDs, startReached, - lastNavigatedTo: oldThread.lastNavigatedTo, - lastPruned: oldThread.lastPruned, }; return updatedThreads[threadID]; } @@ -553,8 +546,6 @@ return { messageIDs: mergedMessageIDs, startReached, - lastNavigatedTo: oldThread.lastNavigatedTo, - lastPruned: oldThread.lastPruned, }; }), _pickBy(thread => !!thread), @@ -1008,7 +999,6 @@ }, ]; - const now = Date.now(); let updatedThreads; let local = { ...messageStore.local }; if (messageStore.messages[localID]) { @@ -1021,8 +1011,6 @@ [threadID]: { messageIDs: sortMessageIDs(messages)(messageIDs), startReached: thread?.startReached ?? true, - lastNavigatedTo: thread?.lastNavigatedTo ?? now, - lastPruned: thread?.lastPruned ?? now, }, }; } else { @@ -1035,8 +1023,6 @@ : { messageIDs: [localID], startReached: true, - lastNavigatedTo: now, - lastPruned: now, }, }; } @@ -1541,7 +1527,6 @@ const messageIDs = messageStore.threads[messageInfo.threadID]?.messageIDs ?? []; - const now = Date.now(); const threadState: ThreadMessageInfo = messageStore.threads[threadID] ? { ...messageStore.threads[threadID], @@ -1550,8 +1535,6 @@ : { messageIDs: [localID], startReached: true, - lastNavigatedTo: now, - lastPruned: now, }; const messageStoreOperations = [ @@ -1738,32 +1721,6 @@ messageStoreOperations, messageStore: processedMessageStore, }; - } else if (action.type === updateThreadLastNavigatedActionType) { - const { threadID, time } = action.payload; - if (!messageStore.threads[threadID]) { - return { messageStoreOperations: [], messageStore }; - } - - const updatedThreads = { - [threadID]: { - ...messageStore.threads[threadID], - lastNavigatedTo: time, - }, - }; - - const messageStoreOperations = [ - { - type: 'replace_threads', - payload: { threads: updatedThreads }, - }, - ]; - - const processedMessageStore = processMessageStoreOperations( - messageStore, - messageStoreOperations, - ); - - return { messageStoreOperations, messageStore: processedMessageStore }; } return { messageStoreOperations: [], messageStore }; } diff --git a/lib/reducers/message-reducer.test.js b/lib/reducers/message-reducer.test.js --- a/lib/reducers/message-reducer.test.js +++ b/lib/reducers/message-reducer.test.js @@ -42,8 +42,6 @@ '91140': { messageIDs: ['local1'], startReached: true, - lastNavigatedTo: 1639522314170, - lastPruned: 1639522292271, }, }, local: {}, @@ -271,8 +269,6 @@ '88471': { messageIDs: ['local11', 'local10', '103502'], startReached: false, - lastNavigatedTo: 1658172614602, - lastPruned: 1658169913623, }, }; diff --git a/lib/shared/message-utils.js b/lib/shared/message-utils.js --- a/lib/shared/message-utils.js +++ b/lib/shared/message-utils.js @@ -482,8 +482,6 @@ return { messageIDs: mergedMessageIDs, startReached: first.startReached && second.startReached, - lastNavigatedTo: Math.max(first.lastNavigatedTo, second.lastNavigatedTo), - lastPruned: Math.max(first.lastPruned, second.lastPruned), }; } diff --git a/lib/types/message-types.js b/lib/types/message-types.js --- a/lib/types/message-types.js +++ b/lib/types/message-types.js @@ -388,15 +388,11 @@ export type ThreadMessageInfo = { messageIDs: string[], startReached: boolean, - lastNavigatedTo: number, // millisecond timestamp - lastPruned: number, // millisecond timestamp }; const threadMessageInfoValidator: TInterface = tShape({ messageIDs: t.list(tID), startReached: t.Boolean, - lastNavigatedTo: t.Number, - lastPruned: t.Number, }); // Tracks client-local information about a message that hasn't been assigned an diff --git a/lib/utils/message-ops-utils.js b/lib/utils/message-ops-utils.js --- a/lib/utils/message-ops-utils.js +++ b/lib/utils/message-ops-utils.js @@ -243,8 +243,6 @@ type TranslatedThreadMessageInfo = { +startReached: boolean, - +lastNavigatedTo: number, - +lastPruned: number, }; export type TranslatedThreadMessageInfos = { +[threadID: string]: TranslatedThreadMessageInfo, @@ -257,8 +255,6 @@ threadInfo.id, { startReached: threadInfo.start_reached === '1', - lastNavigatedTo: parseInt(threadInfo.last_navigated_to), - lastPruned: parseInt(threadInfo.last_pruned), }, ]), ); @@ -269,8 +265,8 @@ threadMessageInfo: ThreadMessageInfo | TranslatedThreadMessageInfo, ): ClientDBThreadMessageInfo { const startReached = threadMessageInfo.startReached ? 1 : 0; - const lastNavigatedTo = threadMessageInfo.lastNavigatedTo ?? 0; - const lastPruned = threadMessageInfo.lastPruned ?? 0; + const lastNavigatedTo = 0; + const lastPruned = 0; return { id, start_reached: startReached.toString(), diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -799,8 +799,6 @@ // eslint-disable-next-line no-unused-vars type PersistedThreadMessageInfo = { +startReached: boolean, - +lastNavigatedTo: number, - +lastPruned: number, }; type PersistedMessageStore = { +local: { +[id: string]: LocalMessageInfo }, diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js --- a/web/redux/redux-setup.js +++ b/web/redux/redux-setup.js @@ -333,16 +333,6 @@ const now = Date.now(); state = { ...state, - messageStore: { - ...state.messageStore, - threads: { - ...state.messageStore.threads, - [activeThread]: { - ...state.messageStore.threads[activeThread], - lastNavigatedTo: now, - }, - }, - }, threadActivityStore: { ...state.threadActivityStore, [activeThread]: {