Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351669
D13835.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
8 KB
Referenced Files
None
Subscribers
None
D13835.diff
View Options
diff --git a/lib/utils/migration-utils.js b/lib/utils/migration-utils.js
--- a/lib/utils/migration-utils.js
+++ b/lib/utils/migration-utils.js
@@ -6,10 +6,7 @@
import { getConfig } from './config.js';
import type { TranslatedThreadMessageInfos } from './message-ops-utils.js';
import { entries } from './objects.js';
-import {
- convertRawMessageInfoToNewIDSchema,
- convertRawThreadInfoToNewIDSchema,
-} from '../_generated/migration-utils.js';
+import { convertRawThreadInfoToNewIDSchema } from '../_generated/migration-utils.js';
import {
parsePendingThreadID,
getPendingThreadID,
@@ -20,7 +17,6 @@
ClientDBDraftStoreOperation,
DraftStore,
} from '../types/draft-types';
-import type { RawMessageInfo } from '../types/message-types.js';
import type { BaseNavInfo } from '../types/nav-types.js';
import type { BaseAppState } from '../types/redux-types.js';
import type { StoreOperations } from '../types/store-ops-types.js';
@@ -123,20 +119,6 @@
return threadID;
}
-function convertNotificationMessageInfoToNewIDSchema(
- messageInfosString: ?string,
-): ?$ReadOnlyArray<RawMessageInfo> {
- let messageInfos: ?$ReadOnlyArray<RawMessageInfo> = null;
- if (messageInfosString) {
- messageInfos = JSON.parse(messageInfosString);
- }
-
- if (messageInfos?.some(message => message.threadID.indexOf('|') === -1)) {
- messageInfos = messageInfos?.map(convertRawMessageInfoToNewIDSchema);
- }
- return messageInfos;
-}
-
// This is an array of all permissions that need to be removed
// in an upcoming migration for roles. Once the migrations are landed,
// no changes to this array should be made to prevent future migrations
@@ -355,9 +337,7 @@
generateIDSchemaMigrationOpsForDrafts,
convertMessageStoreThreadsToNewIDSchema,
convertThreadStoreThreadInfosToNewIDSchema,
- convertNonPendingIDToNewSchema,
convertIDToNewSchema,
- convertNotificationMessageInfoToNewIDSchema,
permissionsToRemoveInMigration,
createAsyncMigrate,
runMigrations,
diff --git a/native/push/android.js b/native/push/android.js
--- a/native/push/android.js
+++ b/native/push/android.js
@@ -4,13 +4,6 @@
import { mergePrefixIntoBody } from 'lib/shared/notif-utils.js';
import type { RawMessageInfo } from 'lib/types/message-types.js';
-import {
- convertNonPendingIDToNewSchema,
- convertNotificationMessageInfoToNewIDSchema,
-} from 'lib/utils/migration-utils.js';
-import { thickThreadIDRegex } from 'lib/utils/validation-utils.js';
-
-import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
type CommAndroidNotificationsConstants = {
+NOTIFICATIONS_IMPORTANCE_HIGH: number,
@@ -51,23 +44,10 @@
};
function parseAndroidMessage(message: AndroidMessage): ParsedAndroidMessage {
- const { threadID, messageInfos } = message;
- if (thickThreadIDRegex.test(threadID)) {
- return {
- ...message,
- messageInfos: messageInfos ? JSON.parse(messageInfos) : null,
- };
- }
-
+ const { messageInfos } = message;
return {
...message,
- threadID: convertNonPendingIDToNewSchema(
- message.threadID,
- authoritativeKeyserverID,
- ),
- messageInfos: convertNotificationMessageInfoToNewIDSchema(
- message.messageInfos,
- ),
+ messageInfos: messageInfos ? JSON.parse(messageInfos) : null,
};
}
diff --git a/native/push/comm-ios-notification.js b/native/push/comm-ios-notification.js
--- a/native/push/comm-ios-notification.js
+++ b/native/push/comm-ios-notification.js
@@ -3,13 +3,6 @@
import { NativeModules } from 'react-native';
import type { RawMessageInfo } from 'lib/types/message-types.js';
-import {
- convertNonPendingIDToNewSchema,
- convertNotificationMessageInfoToNewIDSchema,
-} from 'lib/utils/migration-utils.js';
-import { thickThreadIDRegex } from 'lib/utils/validation-utils.js';
-
-import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
const { CommIOSNotifications } = NativeModules;
@@ -50,25 +43,10 @@
constructor(notification: CoreIOSNotificationData) {
this.remoteNotificationCompleteCallbackCalled = false;
- const { threadID, messageInfos } = notification;
-
- if (thickThreadIDRegex.test(threadID)) {
- this.data = {
- ...notification,
- messageInfos: messageInfos ? JSON.parse(messageInfos) : null,
- };
- return;
- }
-
+ const { messageInfos } = notification;
this.data = {
...notification,
- threadID: convertNonPendingIDToNewSchema(
- notification.threadID,
- authoritativeKeyserverID,
- ),
- messageInfos: convertNotificationMessageInfoToNewIDSchema(
- notification.messageInfos,
- ),
+ messageInfos: messageInfos ? JSON.parse(messageInfos) : null,
};
}
diff --git a/native/push/push-handler.react.js b/native/push/push-handler.react.js
--- a/native/push/push-handler.react.js
+++ b/native/push/push-handler.react.js
@@ -40,10 +40,6 @@
import type { Dispatch } from 'lib/types/redux-types.js';
import type { ConnectionInfo } from 'lib/types/socket-types.js';
import type { GlobalTheme } from 'lib/types/theme-types.js';
-import {
- convertNonPendingIDToNewSchema,
- convertNotificationMessageInfoToNewIDSchema,
-} from 'lib/utils/migration-utils.js';
import { shouldSkipPushPermissionAlert } from 'lib/utils/push-alerts.js';
import {
type DispatchActionPromise,
@@ -73,7 +69,6 @@
iosPushPermissionResponseReceived,
requestIOSPushPermissions,
} from './ios.js';
-import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
import {
type MessageListParams,
useNavigateToThread,
@@ -720,7 +715,9 @@
backgroundData: CoreIOSNotificationBackgroundData,
) => {
const convertedMessageInfos = backgroundData.messageInfosArray
- .flatMap(convertNotificationMessageInfoToNewIDSchema)
+ .flatMap(messageInfosString =>
+ messageInfosString ? JSON.parse(messageInfosString) : null,
+ )
.filter(Boolean);
if (!convertedMessageInfos.length) {
@@ -774,12 +771,8 @@
}
androidNotificationOpened = async (threadID: string) => {
- const convertedThreadID = convertNonPendingIDToNewSchema(
- threadID,
- authoritativeKeyserverID,
- );
this.onPushNotifBootsApp();
- this.onPressNotificationForThread(convertedThreadID, true);
+ this.onPressNotificationForThread(threadID, true);
};
androidMessageReceived = async (message: AndroidMessage) => {
diff --git a/web/push-notif/push-notifs-handler.js b/web/push-notif/push-notifs-handler.js
--- a/web/push-notif/push-notifs-handler.js
+++ b/web/push-notif/push-notifs-handler.js
@@ -19,7 +19,6 @@
import { isDesktopPlatform } from 'lib/types/device-types.js';
import type { SenderDeviceDescriptor } from 'lib/types/notif-types.js';
import { getConfig } from 'lib/utils/config.js';
-import { convertNonPendingIDToNewSchema } from 'lib/utils/migration-utils.js';
import { shouldSkipPushPermissionAlert } from 'lib/utils/push-alerts.js';
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
@@ -28,7 +27,6 @@
decryptDesktopNotification,
migrateLegacyOlmNotificationsSessions,
} from './notif-crypto-utils.js';
-import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
import electron from '../electron.js';
import PushNotifModal from '../modals/push-notif-modal.react.js';
import { updateNavInfoActionType } from '../redux/action-types.js';
@@ -109,14 +107,9 @@
() =>
electron?.onNotificationClicked?.(
({ threadID }: { +threadID: string }) => {
- const convertedThreadID = convertNonPendingIDToNewSchema(
- threadID,
- authoritativeKeyserverID,
- );
-
const payload = {
chatMode: 'view',
- activeChatThreadID: convertedThreadID,
+ activeChatThreadID: threadID,
tab: 'chat',
};
diff --git a/web/push-notif/service-worker.js b/web/push-notif/service-worker.js
--- a/web/push-notif/service-worker.js
+++ b/web/push-notif/service-worker.js
@@ -7,7 +7,6 @@
PlainTextWebNotification,
WebNotification,
} from 'lib/types/notif-types.js';
-import { convertNonPendingIDToNewSchema } from 'lib/utils/migration-utils.js';
import {
decryptWebNotification,
@@ -17,7 +16,6 @@
type WebNotifDecryptionError,
} from './notif-crypto-utils.js';
import { persistAuthMetadata } from './services-client.js';
-import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
import { localforageConfig } from '../shared-worker/utils/constants.js';
declare class PushMessageData {
@@ -162,10 +160,7 @@
// navigation.
let threadID;
if (!event.notification.data.isError) {
- threadID = convertNonPendingIDToNewSchema(
- event.notification.data.threadID,
- authoritativeKeyserverID,
- );
+ threadID = event.notification.data.threadID;
}
if (selectedClient) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 3:04 AM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573633
Default Alt Text
D13835.diff (8 KB)
Attached To
Mode
D13835: [lib][native][web] Stop running ID schema migration on notifs
Attached
Detach File
Event Timeline
Log In to Comment