diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -62,6 +62,7 @@ type MessageStoreThreads, type RawMessageInfo, } from 'lib/types/message-types.js'; +import { minimallyEncodeRawThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ReportStore, ClientReportCreationRequest, @@ -75,6 +76,7 @@ ClientDBThreadInfo, LegacyRawThreadInfo, RawThreadInfo, + RawThreadInfos, } from 'lib/types/thread-types.js'; import { translateClientDBMessageInfoToRawMessageInfo, @@ -989,6 +991,22 @@ state, legacyUpdateRolesAndPermissions, ), + [61]: (state: AppState) => { + const minimallyEncodeThreadInfosFunc = ( + threadStoreInfos: RawThreadInfos, + ): RawThreadInfos => + Object.keys(threadStoreInfos).reduce( + (acc: { [string]: RawThreadInfo }, key: string) => { + const threadInfo = threadStoreInfos[key]; + acc[threadInfo.id] = threadInfo.minimallyEncoded + ? threadInfo + : minimallyEncodeRawThreadInfo(threadInfo); + return acc; + }, + {}, + ); + updateClientDBThreadStoreThreadInfos(state, minimallyEncodeThreadInfosFunc); + }, }; // After migration 31, we'll no longer want to persist `messageStore.messages`