Page MenuHomePhabricator

D8506.id28742.diff
No OneTemporary

D8506.id28742.diff

diff --git a/keyserver/src/responders/thread-responders.js b/keyserver/src/responders/thread-responders.js
--- a/keyserver/src/responders/thread-responders.js
+++ b/keyserver/src/responders/thread-responders.js
@@ -3,7 +3,6 @@
import t from 'tcomb';
import type { TInterface, TUnion } from 'tcomb';
-import { rawEntryInfoValidator } from 'lib/types/entry-types.js';
import { mediaValidator } from 'lib/types/media-types.js';
import {
rawMessageInfoValidator,
@@ -268,14 +267,12 @@
export const threadJoinResultValidator: TInterface<ThreadJoinResult> =
tShape<ThreadJoinResult>({
- threadInfos: t.maybe(t.dict(tID, rawThreadInfoValidator)),
updatesResult: tShape({
newUpdates: t.list(serverUpdateInfoValidator),
}),
rawMessageInfos: t.list(rawMessageInfoValidator),
truncationStatuses: messageTruncationStatusesValidator,
userInfos: userInfosValidator,
- rawEntryInfos: t.maybe(t.list(rawEntryInfoValidator)),
});
async function threadJoinResponder(
diff --git a/keyserver/src/updaters/thread-updaters.js b/keyserver/src/updaters/thread-updaters.js
--- a/keyserver/src/updaters/thread-updaters.js
+++ b/keyserver/src/updaters/thread-updaters.js
@@ -13,7 +13,6 @@
import { hasMinCodeVersion } from 'lib/shared/version-utils.js';
import type { Shape } from 'lib/types/core.js';
import { messageTypes } from 'lib/types/message-types-enum.js';
-import { defaultNumberPerThread } from 'lib/types/message-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
import {
@@ -43,12 +42,8 @@
import createMessages from '../creators/message-creator.js';
import { createUpdates } from '../creators/update-creator.js';
import { dbQuery, SQL } from '../database/database.js';
-import { fetchEntryInfos } from '../fetchers/entry-fetchers.js';
import { checkIfInviteLinkIsValid } from '../fetchers/link-fetchers.js';
-import {
- fetchMessageInfos,
- fetchMessageInfoByID,
-} from '../fetchers/message-fetchers.js';
+import { fetchMessageInfoByID } from '../fetchers/message-fetchers.js';
import {
fetchThreadInfos,
fetchServerThreadInfos,
@@ -855,14 +850,6 @@
throw new ServerError('invalid_parameters');
}
- // TODO: determine code version
- const hasCodeVersionBelow87 = !hasMinCodeVersion(viewer.platformDetails, {
- native: 87,
- });
- const hasCodeVersionBelow62 = !hasMinCodeVersion(viewer.platformDetails, {
- native: 62,
- });
-
const { calendarQuery } = request;
if (isMember) {
const response: ThreadJoinResult = {
@@ -873,12 +860,6 @@
newUpdates: [],
},
};
- if (calendarQuery && hasCodeVersionBelow87) {
- response.rawEntryInfos = [];
- }
- if (hasCodeVersionBelow62) {
- response.threadInfos = {};
- }
return response;
}
@@ -911,41 +892,14 @@
};
const newMessages = await createMessages(viewer, [messageData]);
- const messageSelectionCriteria = {
- threadCursors: { [request.threadID]: false },
- };
-
- if (!hasCodeVersionBelow87) {
- return {
- rawMessageInfos: newMessages,
- truncationStatuses: {},
- userInfos: membershipResult.userInfos,
- updatesResult: {
- newUpdates: membershipResult.viewerUpdates,
- },
- };
- }
-
- const [fetchMessagesResult, fetchEntriesResult] = await Promise.all([
- fetchMessageInfos(viewer, messageSelectionCriteria, defaultNumberPerThread),
- calendarQuery ? fetchEntryInfos(viewer, [calendarQuery]) : undefined,
- ]);
- const rawEntryInfos = fetchEntriesResult && fetchEntriesResult.rawEntryInfos;
- const response: ThreadJoinResult = {
- rawMessageInfos: fetchMessagesResult.rawMessageInfos,
- truncationStatuses: fetchMessagesResult.truncationStatuses,
+ return {
+ rawMessageInfos: newMessages,
+ truncationStatuses: {},
userInfos: membershipResult.userInfos,
updatesResult: {
newUpdates: membershipResult.viewerUpdates,
},
};
- if (hasCodeVersionBelow62) {
- response.threadInfos = membershipResult.threadInfos;
- }
- if (rawEntryInfos) {
- response.rawEntryInfos = rawEntryInfos;
- }
- return response;
}
async function toggleMessagePinForThread(
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
@@ -9,7 +9,7 @@
type UpdateUserAvatarRequest,
} from './avatar-types.js';
import type { Shape } from './core.js';
-import type { CalendarQuery, RawEntryInfo } from './entry-types.js';
+import type { CalendarQuery } from './entry-types.js';
import type { Media } from './media-types.js';
import type {
MessageTruncationStatuses,
@@ -388,14 +388,12 @@
+inviteLinkSecret?: string,
};
export type ThreadJoinResult = {
- threadInfos?: { +[id: string]: RawThreadInfo },
- updatesResult: {
- newUpdates: $ReadOnlyArray<ServerUpdateInfo>,
+ +updatesResult: {
+ +newUpdates: $ReadOnlyArray<ServerUpdateInfo>,
},
- rawMessageInfos: $ReadOnlyArray<RawMessageInfo>,
- truncationStatuses: MessageTruncationStatuses,
- userInfos: UserInfos,
- rawEntryInfos?: ?$ReadOnlyArray<RawEntryInfo>,
+ +rawMessageInfos: $ReadOnlyArray<RawMessageInfo>,
+ +truncationStatuses: MessageTruncationStatuses,
+ +userInfos: UserInfos,
};
export type ThreadJoinPayload = {
+updatesResult: {

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 9:37 PM (7 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2711762
Default Alt Text
D8506.id28742.diff (5 KB)

Event Timeline