diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -63,7 +63,10 @@ MinimallyEncodedThreadCurrentUserInfo, MinimallyEncodedThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; -import { decodeMinimallyEncodedRoleInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import { + decodeMinimallyEncodedRoleInfo, + minimallyEncodeThreadInfo, +} from '../types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from '../types/relationship-types.js'; import { threadPermissionPropagationPrefixes, @@ -333,7 +336,7 @@ threadColor, name, sourceMessageID, -}: CreatePendingThreadArgs): LegacyThreadInfo { +}: CreatePendingThreadArgs): MinimallyEncodedThreadInfo { const now = Date.now(); if (!members.some(member => member.id === viewerID)) { throw new Error( @@ -510,7 +513,7 @@ }; function baseCreatePendingSidebar( input: BaseCreatePendingSidebarInput, -): LegacyThreadInfo { +): MinimallyEncodedThreadInfo { const { sourceMessageInfo, parentThreadInfo, @@ -586,7 +589,7 @@ }; function createUnresolvedPendingSidebar( input: CreateUnresolvedPendingSidebarInput, -): LegacyThreadInfo { +): MinimallyEncodedThreadInfo { const { sourceMessageInfo, parentThreadInfo, @@ -619,7 +622,7 @@ }; async function createPendingSidebar( input: CreatePendingSidebarInput, -): Promise { +): Promise { const { sourceMessageInfo, parentThreadInfo, @@ -890,7 +893,7 @@ rawThreadInfo: LegacyRawThreadInfo, viewerID: ?string, userInfos: UserInfos, -): LegacyThreadInfo { +): MinimallyEncodedThreadInfo { let threadInfo: LegacyThreadInfo = { id: rawThreadInfo.id, type: rawThreadInfo.type, @@ -931,8 +934,7 @@ if (pinnedCount) { threadInfo = { ...threadInfo, pinnedCount }; } - - return threadInfo; + return minimallyEncodeThreadInfo(threadInfo); } function getCurrentUser(