diff --git a/lib/reducers/calendar-filters-reducer.js b/lib/reducers/calendar-filters-reducer.js --- a/lib/reducers/calendar-filters-reducer.js +++ b/lib/reducers/calendar-filters-reducer.js @@ -41,7 +41,10 @@ fullStateSyncActionType, incrementalStateSyncActionType, } from '../types/socket-types.js'; -import type { RawThreadInfos, ThreadStore } from '../types/thread-types.js'; +import type { + MinimallyEncodedRawThreadInfos, + ThreadStore, +} from '../types/thread-types.js'; import { type ClientUpdateInfo, processUpdatesActionType, @@ -184,7 +187,7 @@ function removeDeletedThreadIDsFromFilterList( state: $ReadOnlyArray, - threadInfos: RawThreadInfos, + threadInfos: MinimallyEncodedRawThreadInfos, ): $ReadOnlyArray { const filterCondition = (threadID: string) => threadInFilterList(threadInfos[threadID]); diff --git a/lib/reducers/entry-reducer.js b/lib/reducers/entry-reducer.js --- a/lib/reducers/entry-reducer.js +++ b/lib/reducers/entry-reducer.js @@ -56,7 +56,7 @@ fullStateSyncActionType, incrementalStateSyncActionType, } from '../types/socket-types.js'; -import { type RawThreadInfos } from '../types/thread-types.js'; +import type { MinimallyEncodedRawThreadInfos } from '../types/thread-types.js'; import { type ClientUpdateInfo, processUpdatesActionType, @@ -91,7 +91,7 @@ currentEntryInfos: { +[id: string]: RawEntryInfo }, currentDaysToEntries: ?{ +[day: string]: string[] }, newEntryInfos: $ReadOnlyArray, - threadInfos: RawThreadInfos, + threadInfos: MinimallyEncodedRawThreadInfos, ) { const mergedEntryInfos: { [string]: RawEntryInfo } = {}; let someEntryUpdated = false; @@ -164,7 +164,7 @@ function reduceEntryInfos( entryStore: EntryStore, action: BaseAction, - newThreadInfos: RawThreadInfos, + newThreadInfos: MinimallyEncodedRawThreadInfos, ): [EntryStore, $ReadOnlyArray] { const { entryInfos, daysToEntries, lastUserInteractionCalendar } = entryStore; if ( 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 @@ -98,6 +98,7 @@ import { threadPermissions } from '../types/thread-permission-types.js'; import type { LegacyRawThreadInfo, + MinimallyEncodedRawThreadInfos, RawThreadInfos, } from '../types/thread-types.js'; import { @@ -216,7 +217,7 @@ function reassignMessagesToRealizedThreads( messageStore: MessageStore, - threadInfos: RawThreadInfos, + threadInfos: MinimallyEncodedRawThreadInfos, ): ReassignmentResult { const pendingToRealizedThreadIDs = pendingToRealizedThreadIDsSelector(threadInfos); @@ -309,7 +310,7 @@ oldMessageStore: MessageStore, newMessageInfos: $ReadOnlyArray, truncationStatus: { +[threadID: string]: MessageTruncationStatus }, - threadInfos: RawThreadInfos, + threadInfos: MinimallyEncodedRawThreadInfos, ): MergeNewMessagesResult { const { messageStoreOperations: updateWithLatestThreadInfosOps, @@ -633,7 +634,7 @@ }; function updateMessageStoreWithLatestThreadInfos( messageStore: MessageStore, - threadInfos: RawThreadInfos, + threadInfos: MinimallyEncodedRawThreadInfos, ): UpdateMessageStoreWithLatestThreadInfosResult { const messageStoreOperations: MessageStoreOperation[] = []; const { @@ -701,7 +702,7 @@ function ensureRealizedThreadIDIsUsedWhenPossible( payload: T, - threadInfos: RawThreadInfos, + threadInfos: MinimallyEncodedRawThreadInfos, ): T { const pendingToRealizedThreadIDs = pendingToRealizedThreadIDsSelector(threadInfos); @@ -721,7 +722,7 @@ function reduceMessageStore( messageStore: MessageStore, action: BaseAction, - newThreadInfos: RawThreadInfos, + newThreadInfos: MinimallyEncodedRawThreadInfos, ): ReduceMessageStoreResult { if ( action.type === logInActionTypes.success || diff --git a/lib/selectors/thread-selectors.js b/lib/selectors/thread-selectors.js --- a/lib/selectors/thread-selectors.js +++ b/lib/selectors/thread-selectors.js @@ -420,7 +420,7 @@ (state: BaseAppState<>) => state.threadStore.threadInfos, threadInfoSelector, ( - rawThreadInfos: RawThreadInfos, + rawThreadInfos: MinimallyEncodedRawThreadInfos, threadInfos: { +[id: string]: ThreadInfo }, ) => { const pendingToRealizedThreadIDs = @@ -436,10 +436,10 @@ }, ); const pendingToRealizedThreadIDsSelector: ( - rawThreadInfos: RawThreadInfos, + rawThreadInfos: MinimallyEncodedRawThreadInfos, ) => $ReadOnlyMap = createSelector( - (rawThreadInfos: RawThreadInfos) => rawThreadInfos, - (rawThreadInfos: RawThreadInfos) => { + (rawThreadInfos: MinimallyEncodedRawThreadInfos) => rawThreadInfos, + (rawThreadInfos: MinimallyEncodedRawThreadInfos) => { const result = new Map(); for (const threadID in rawThreadInfos) { const rawThreadInfo = rawThreadInfos[threadID]; diff --git a/lib/selectors/user-selectors.js b/lib/selectors/user-selectors.js --- a/lib/selectors/user-selectors.js +++ b/lib/selectors/user-selectors.js @@ -16,7 +16,7 @@ import type { LegacyRawThreadInfo, RelativeMemberInfo, - RawThreadInfos, + MinimallyEncodedRawThreadInfos, } from '../types/thread-types.js'; import type { UserInfos, @@ -173,7 +173,7 @@ ) => $ReadOnlySet = createSelector( (state: BaseAppState<>) => state.currentUserInfo && state.currentUserInfo.id, (state: BaseAppState<>) => state.threadStore.threadInfos, - (viewerID: ?string, threadInfos: RawThreadInfos) => { + (viewerID: ?string, threadInfos: MinimallyEncodedRawThreadInfos) => { const personalThreadMembers = new Set(); for (const threadID in threadInfos) { 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 @@ -6,7 +6,7 @@ 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 type { RawThreadInfos } from 'lib/types/thread-types.js'; +import type { MinimallyEncodedRawThreadInfos } from 'lib/types/thread-types.js'; import { activeThreadSelector } from '../navigation/nav-selectors.js'; import type { AppState } from '../redux/state-types.js'; @@ -19,7 +19,7 @@ (state: AppState) => state.threadStore.threadInfos, (state: AppState) => state.threadActivityStore, ( - threadInfos: RawThreadInfos, + threadInfos: MinimallyEncodedRawThreadInfos, threadActivityStore: ThreadActivityStore, ): ?number => { let nextTime; diff --git a/web/redux/nav-reducer.js b/web/redux/nav-reducer.js --- a/web/redux/nav-reducer.js +++ b/web/redux/nav-reducer.js @@ -2,7 +2,7 @@ import { pendingToRealizedThreadIDsSelector } from 'lib/selectors/thread-selectors.js'; import { threadIsPending } from 'lib/shared/thread-utils.js'; -import type { RawThreadInfos } from 'lib/types/thread-types.js'; +import type { MinimallyEncodedRawThreadInfos } from 'lib/types/thread-types.js'; import { updateNavInfoActionType } from '../redux/action-types.js'; import type { Action } from '../redux/redux-setup.js'; @@ -11,7 +11,7 @@ export default function reduceNavInfo( oldState: NavInfo, action: Action, - newThreadInfos: RawThreadInfos, + newThreadInfos: MinimallyEncodedRawThreadInfos, ): NavInfo { let state = oldState; if (action.type === updateNavInfoActionType) {