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 @@ -62,7 +62,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, @@ -332,7 +335,7 @@ threadColor, name, sourceMessageID, -}: CreatePendingThreadArgs): LegacyThreadInfo { +}: CreatePendingThreadArgs): MinimallyEncodedThreadInfo { const now = Date.now(); if (!members.some(member => member.id === viewerID)) { throw new Error( @@ -509,7 +512,7 @@ }; function baseCreatePendingSidebar( input: BaseCreatePendingSidebarInput, -): LegacyThreadInfo { +): MinimallyEncodedThreadInfo { const { sourceMessageInfo, parentThreadInfo, @@ -585,7 +588,7 @@ }; function createUnresolvedPendingSidebar( input: CreateUnresolvedPendingSidebarInput, -): LegacyThreadInfo { +): MinimallyEncodedThreadInfo { const { sourceMessageInfo, parentThreadInfo, @@ -618,7 +621,7 @@ }; async function createPendingSidebar( input: CreatePendingSidebarInput, -): Promise { +): Promise { const { sourceMessageInfo, parentThreadInfo, @@ -889,7 +892,7 @@ rawThreadInfo: LegacyRawThreadInfo, viewerID: ?string, userInfos: UserInfos, -): LegacyThreadInfo { +): MinimallyEncodedThreadInfo { let threadInfo: LegacyThreadInfo = { id: rawThreadInfo.id, type: rawThreadInfo.type, @@ -930,8 +933,7 @@ if (pinnedCount) { threadInfo = { ...threadInfo, pinnedCount }; } - - return threadInfo; + return minimallyEncodeThreadInfo(threadInfo); } function getCurrentUser(