Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3499188
D8386.id28548.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D8386.id28548.diff
View Options
diff --git a/keyserver/src/push/rescind.js b/keyserver/src/push/rescind.js
--- a/keyserver/src/push/rescind.js
+++ b/keyserver/src/push/rescind.js
@@ -3,7 +3,7 @@
import apn from '@parse/node-apn';
import invariant from 'invariant';
-import { NEXT_CODE_VERSION } from 'lib/shared/version-utils.js';
+import { NEXT_NATIVE_CODE_VERSION } from 'lib/shared/version-utils.js';
import { threadSubscriptions } from 'lib/types/subscription-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import { promiseAll } from 'lib/utils/promises.js';
@@ -227,7 +227,8 @@
notification: T,
) => Promise<$ReadOnlyArray<T>>,
): Promise<$ReadOnlyArray<{ +deviceToken: string, +notification: T }>> {
- const shouldBeEncrypted = codeVersion && codeVersion > NEXT_CODE_VERSION;
+ const shouldBeEncrypted =
+ codeVersion && codeVersion > NEXT_NATIVE_CODE_VERSION;
if (!shouldBeEncrypted) {
return devices.map(({ deviceToken }) => ({
notification,
diff --git a/keyserver/src/utils/validation-utils.js b/keyserver/src/utils/validation-utils.js
--- a/keyserver/src/utils/validation-utils.js
+++ b/keyserver/src/utils/validation-utils.js
@@ -5,7 +5,8 @@
import type { PolicyType } from 'lib/facts/policies.js';
import {
hasMinCodeVersion,
- FUTURE_CODE_VERSION,
+ NEXT_NATIVE_CODE_VERSION,
+ NEXT_WEB_CODE_VERSION,
} from 'lib/shared/version-utils.js';
import { type PlatformDetails } from 'lib/types/device-types.js';
import { ServerError } from 'lib/utils/errors.js';
@@ -15,7 +16,6 @@
tPlatform,
tPlatformDetails,
assertWithValidator,
- convertToNewIDSchema,
keyserverPrefixID,
convertClientIDsToServerIDs,
convertObject,
@@ -38,10 +38,9 @@
if (
hasMinCodeVersion(viewer.platformDetails, {
- native: FUTURE_CODE_VERSION,
- web: FUTURE_CODE_VERSION,
- }) &&
- convertToNewIDSchema
+ native: NEXT_NATIVE_CODE_VERSION,
+ web: NEXT_WEB_CODE_VERSION,
+ })
) {
try {
return convertClientIDsToServerIDs(
@@ -72,12 +71,11 @@
}
if (
- (hasMinCodeVersion(platformDetails, {
- native: FUTURE_CODE_VERSION,
- web: FUTURE_CODE_VERSION,
+ hasMinCodeVersion(platformDetails, {
+ native: NEXT_NATIVE_CODE_VERSION,
+ web: NEXT_WEB_CODE_VERSION,
}) ||
- alwaysConvertSchema) &&
- convertToNewIDSchema
+ alwaysConvertSchema
) {
return convertServerIDsToClientIDs(
keyserverPrefixID,
diff --git a/lib/selectors/socket-selectors.js b/lib/selectors/socket-selectors.js
--- a/lib/selectors/socket-selectors.js
+++ b/lib/selectors/socket-selectors.js
@@ -42,7 +42,6 @@
tID,
convertClientIDsToServerIDs,
keyserverPrefixID,
- convertToNewIDSchema,
} from '../utils/validation-utils.js';
const queuedReports: (
@@ -75,23 +74,21 @@
currentUserInfo: ?CurrentUserInfo,
calendarQuery: (calendarActive: boolean) => CalendarQuery,
) => {
- if (convertToNewIDSchema) {
- threadInfos = convertClientIDsToServerIDs(
- keyserverPrefixID,
- t.dict(tID, rawThreadInfoValidator),
- threadInfos,
- );
- userInfos = convertClientIDsToServerIDs(
- keyserverPrefixID,
- userInfosValidator,
- userInfos,
- );
- currentUserInfo = convertClientIDsToServerIDs(
- keyserverPrefixID,
- t.maybe(currentUserInfoValidator),
- currentUserInfo,
- );
- }
+ threadInfos = convertClientIDsToServerIDs(
+ keyserverPrefixID,
+ t.dict(tID, rawThreadInfoValidator),
+ threadInfos,
+ );
+ userInfos = convertClientIDsToServerIDs(
+ keyserverPrefixID,
+ userInfosValidator,
+ userInfos,
+ );
+ currentUserInfo = convertClientIDsToServerIDs(
+ keyserverPrefixID,
+ t.maybe(currentUserInfoValidator),
+ currentUserInfo,
+ );
return async (
calendarActive: boolean,
@@ -124,13 +121,11 @@
calendarQuery(calendarActive),
);
- if (convertToNewIDSchema) {
- filteredEntryInfos = convertClientIDsToServerIDs(
- keyserverPrefixID,
- t.dict(tID, rawEntryInfoValidator),
- filteredEntryInfos,
- );
- }
+ filteredEntryInfos = convertClientIDsToServerIDs(
+ keyserverPrefixID,
+ t.dict(tID, rawEntryInfoValidator),
+ filteredEntryInfos,
+ );
const hashResults = {};
for (const key in serverRequest.hashesToCheck) {
diff --git a/lib/shared/version-utils.js b/lib/shared/version-utils.js
--- a/lib/shared/version-utils.js
+++ b/lib/shared/version-utils.js
@@ -12,7 +12,8 @@
* A code version used for features that are waiting to be included
* in the very next release
*/
-const NEXT_CODE_VERSION = 1000000;
+const NEXT_NATIVE_CODE_VERSION = 1000000;
+const NEXT_WEB_CODE_VERSION = 1000000;
function hasMinCodeVersion(
platformDetails: ?PlatformDetails,
@@ -36,4 +37,9 @@
return true;
}
-export { FUTURE_CODE_VERSION, NEXT_CODE_VERSION, hasMinCodeVersion };
+export {
+ FUTURE_CODE_VERSION,
+ NEXT_NATIVE_CODE_VERSION,
+ NEXT_WEB_CODE_VERSION,
+ hasMinCodeVersion,
+};
diff --git a/lib/utils/validation-utils.js b/lib/utils/validation-utils.js
--- a/lib/utils/validation-utils.js
+++ b/lib/utils/validation-utils.js
@@ -103,7 +103,6 @@
return (data: any);
}
-const convertToNewIDSchema = false;
const keyserverPrefixID = '256';
function convertServerIDsToClientIDs<T>(
@@ -242,7 +241,6 @@
tMediaMessageVideo,
tMediaMessageMedia,
assertWithValidator,
- convertToNewIDSchema,
keyserverPrefixID,
convertClientIDsToServerIDs,
convertServerIDsToClientIDs,
diff --git a/native/redux/persist.js b/native/redux/persist.js
--- a/native/redux/persist.js
+++ b/native/redux/persist.js
@@ -742,7 +742,7 @@
'storeLoaded',
],
debug: __DEV__,
- version: 42,
+ version: 43,
transforms: [messageStoreMessagesBlocklistTransform, reportStoreTransform],
migrate: (createAsyncMigrate(migrations, { debug: __DEV__ }): any),
timeout: ((__DEV__ ? 0 : undefined): number | void),
diff --git a/web/redux/persist.js b/web/redux/persist.js
--- a/web/redux/persist.js
+++ b/web/redux/persist.js
@@ -137,7 +137,7 @@
{ debug: isDev },
migrateStorageToSQLite,
): any),
- version: 2,
+ version: 3,
};
export { persistConfig };
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 10:55 PM (16 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2683638
Default Alt Text
D8386.id28548.diff (6 KB)
Attached To
Mode
D8386: [lib] Enable new id schema
Attached
Detach File
Event Timeline
Log In to Comment