Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3542524
D8508.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D8508.diff
View Options
diff --git a/keyserver/src/deleters/thread-deleters.js b/keyserver/src/deleters/thread-deleters.js
--- a/keyserver/src/deleters/thread-deleters.js
+++ b/keyserver/src/deleters/thread-deleters.js
@@ -1,7 +1,6 @@
// @flow
import { permissionLookup } from 'lib/permissions/thread-permissions.js';
-import { hasMinCodeVersion } from 'lib/shared/version-utils.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import {
type ThreadDeletionRequest,
@@ -13,7 +12,6 @@
import { createUpdates } from '../creators/update-creator.js';
import { dbQuery, SQL } from '../database/database.js';
import {
- fetchThreadInfos,
fetchServerThreadInfos,
fetchContainedThreadIDs,
} from '../fetchers/thread-fetchers.js';
@@ -36,16 +34,10 @@
if (!permissionsBlob) {
// This should only occur if the first request goes through but the client
// never receives the response
- const [{ updateInfos }, fetchThreadInfoResult] = await Promise.all([
- fetchUpdateInfoForThreadDeletion(viewer, threadID),
- hasMinCodeVersion(viewer.platformDetails, { native: 62 })
- ? undefined
- : fetchThreadInfos(viewer),
- ]);
- if (fetchThreadInfoResult) {
- const { threadInfos } = fetchThreadInfoResult;
- return { threadInfos, updatesResult: { newUpdates: updateInfos } };
- }
+ const { updateInfos } = await fetchUpdateInfoForThreadDeletion(
+ viewer,
+ threadID,
+ );
return { updatesResult: { newUpdates: updateInfos } };
}
@@ -110,17 +102,7 @@
dbQuery(query),
]);
- if (hasMinCodeVersion(viewer.platformDetails, { native: 62 })) {
- return { updatesResult: { newUpdates: viewerUpdates } };
- }
-
- const { threadInfos } = await fetchThreadInfos(viewer);
- return {
- threadInfos,
- updatesResult: {
- newUpdates: viewerUpdates,
- },
- };
+ return { updatesResult: { newUpdates: viewerUpdates } };
}
async function deleteInaccessibleThreads(): Promise<void> {
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
@@ -64,7 +64,6 @@
export const leaveThreadResultValidator: TInterface<LeaveThreadResult> =
tShape<LeaveThreadResult>({
- threadInfos: t.maybe(t.dict(tID, rawThreadInfoValidator)),
updatesResult: tShape({
newUpdates: t.list(serverUpdateInfoValidator),
}),
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
@@ -277,17 +277,8 @@
const threadInfo = fetchThreadResult.threadInfos[request.threadID];
if (!viewerIsMember(threadInfo)) {
- if (hasMinCodeVersion(viewer.platformDetails, { native: 62 })) {
- return {
- updatesResult: { newUpdates: [] },
- };
- }
- const { threadInfos } = await fetchThreadInfos(viewer);
return {
- threadInfos,
- updatesResult: {
- newUpdates: [],
- },
+ updatesResult: { newUpdates: [] },
};
}
@@ -316,10 +307,7 @@
}
const changeset = await changeRole(request.threadID, [viewerID], 0);
- const { threadInfos, viewerUpdates } = await commitMembershipChangeset(
- viewer,
- changeset,
- );
+ const { viewerUpdates } = await commitMembershipChangeset(viewer, changeset);
const messageData = {
type: messageTypes.LEAVE_THREAD,
@@ -329,16 +317,7 @@
};
await createMessages(viewer, [messageData]);
- if (hasMinCodeVersion(viewer.platformDetails, { native: 62 })) {
- return { updatesResult: { newUpdates: viewerUpdates } };
- }
-
- return {
- threadInfos,
- updatesResult: {
- newUpdates: viewerUpdates,
- },
- };
+ return { updatesResult: { newUpdates: viewerUpdates } };
}
type UpdateThreadOptions = Shape<{
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
@@ -302,7 +302,6 @@
+threadID: string,
};
export type LeaveThreadResult = {
- +threadInfos?: { +[id: string]: RawThreadInfo },
+updatesResult: {
+newUpdates: $ReadOnlyArray<ServerUpdateInfo>,
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 8:27 AM (9 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2712163
Default Alt Text
D8508.diff (4 KB)
Attached To
Mode
D8508: [keyserver][lib] Simplify leaveThread/deleteThread return type following deprecation of old codeVersions
Attached
Detach File
Event Timeline
Log In to Comment