Page MenuHomePhabricator

D9454.diff
No OneTemporary

D9454.diff

diff --git a/native/selectors/message-selectors.js b/native/selectors/message-selectors.js
--- a/native/selectors/message-selectors.js
+++ b/native/selectors/message-selectors.js
@@ -4,6 +4,8 @@
import { threadIsPending } from 'lib/shared/thread-utils.js';
import type { ThreadMessageInfo } from 'lib/types/message-types.js';
+import { defaultNumberPerThread } from 'lib/types/message-types.js';
+import type { ThreadActivityStore } from 'lib/types/thread-activity-types.js';
import { activeThreadSelector } from '../navigation/nav-selectors.js';
import type { AppState } from '../redux/state-types.js';
@@ -33,9 +35,11 @@
const pruneThreadIDsSelector: (
input: NavPlusRedux,
) => () => $ReadOnlyArray<string> = createSelector(
+ (input: NavPlusRedux): ThreadActivityStore => input.redux.threadActivityStore,
(input: NavPlusRedux) => input.redux.messageStore.threads,
(input: NavPlusRedux) => activeThreadSelector(input.navContext),
(
+ threadActivityStore: ThreadActivityStore,
threadMessageInfos: { +[id: string]: ThreadMessageInfo },
activeThread: ?string,
) =>
@@ -48,8 +52,9 @@
}
const threadMessageInfo = threadMessageInfos[threadID];
if (
- threadMessageInfo.lastNavigatedTo + msInHour < now &&
- threadMessageInfo.lastPruned + msInHour * 6 < now
+ (threadActivityStore?.[threadID]?.lastNavigatedTo ?? 0) + msInHour <
+ now &&
+ threadMessageInfo.messageIDs.length > defaultNumberPerThread
) {
threadIDsToPrune.push(threadID);
}

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 3, 3:41 AM (20 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2610088
Default Alt Text
D9454.diff (1 KB)

Event Timeline