Page MenuHomePhabricator

D12660.id41987.diff
No OneTemporary

D12660.id41987.diff

diff --git a/keyserver/src/fetchers/thread-fetchers.js b/keyserver/src/fetchers/thread-fetchers.js
--- a/keyserver/src/fetchers/thread-fetchers.js
+++ b/keyserver/src/fetchers/thread-fetchers.js
@@ -12,13 +12,12 @@
import { hasMinCodeVersion } from 'lib/shared/version-utils.js';
import type { AvatarDBContent, ClientAvatar } from 'lib/types/avatar-types.js';
import type { RawMessageInfo, MessageInfo } from 'lib/types/message-types.js';
-import type { RawThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import type { ThinRawThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes, type ThreadType } from 'lib/types/thread-types-enum.js';
import {
type ServerThreadInfo,
- type MixedRawThreadInfos,
- type LegacyRawThreadInfo,
type ServerLegacyRoleInfo,
+ type LegacyThinRawThreadInfo,
} from 'lib/types/thread-types.js';
import { ServerError } from 'lib/utils/errors.js';
@@ -249,7 +248,9 @@
}
export type FetchThreadInfosResult = {
- +threadInfos: MixedRawThreadInfos,
+ +threadInfos: {
+ +[id: string]: LegacyThinRawThreadInfo | ThinRawThreadInfo,
+ },
};
async function fetchThreadInfos(
@@ -305,7 +306,7 @@
);
const threadInfos: {
- [string]: LegacyRawThreadInfo | RawThreadInfo,
+ [string]: LegacyThinRawThreadInfo | ThinRawThreadInfo,
} = {};
for (const threadID in serverResult.threadInfos) {
const serverThreadInfo = serverResult.threadInfos[threadID];
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
@@ -45,6 +45,7 @@
MemberInfoWithPermissions,
RoleInfo,
ThreadInfo,
+ ThinRawThreadInfo,
} from '../types/minimally-encoded-thread-permissions-types.js';
import {
decodeMinimallyEncodedRoleInfo,
@@ -84,6 +85,7 @@
UserProfileThreadInfo,
MixedRawThreadInfos,
LegacyMemberInfo,
+ LegacyThinRawThreadInfo,
} from '../types/thread-types.js';
import { updateTypes } from '../types/update-types-enum.js';
import { type ClientUpdateInfo } from '../types/update-types.js';
@@ -702,7 +704,7 @@
serverThreadInfo: ServerThreadInfo,
viewerID: string,
options?: RawThreadInfoOptions,
-): ?LegacyRawThreadInfo | ?RawThreadInfo {
+): ?LegacyThinRawThreadInfo | ?ThinRawThreadInfo {
const filterThreadEditAvatarPermission =
options?.filterThreadEditAvatarPermission;
const excludePinInfo = options?.excludePinInfo;
@@ -853,6 +855,7 @@
}
const minimallyEncoded = minimallyEncodeRawThreadInfo(rawThreadInfo);
+ invariant(!minimallyEncoded.thick, 'ServerThreadInfo should be thin thread');
if (shouldIncludeSpecialRoleFieldInRoles) {
return minimallyEncoded;
}
diff --git a/lib/types/thread-types.js b/lib/types/thread-types.js
--- a/lib/types/thread-types.js
+++ b/lib/types/thread-types.js
@@ -184,7 +184,7 @@
export type ServerThreadInfo = {
+id: string,
- +type: ThreadType,
+ +type: ThinThreadType,
+name: ?string,
+avatar?: AvatarDBContent,
+description: ?string,

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 28, 1:08 AM (21 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2592254
Default Alt Text
D12660.id41987.diff (2 KB)

Event Timeline