Page MenuHomePhabricator

D13237.id43894.diff
No OneTemporary

D13237.id43894.diff

diff --git a/native/push/android.js b/native/push/android.js
--- a/native/push/android.js
+++ b/native/push/android.js
@@ -8,6 +8,7 @@
convertNonPendingIDToNewSchema,
convertNotificationMessageInfoToNewIDSchema,
} from 'lib/utils/migration-utils.js';
+import { thickThreadIDRegex } from 'lib/utils/validation-utils.js';
import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
@@ -50,6 +51,14 @@
};
function parseAndroidMessage(message: AndroidMessage): ParsedAndroidMessage {
+ const { threadID, messageInfos } = message;
+ if (thickThreadIDRegex.test(threadID)) {
+ return {
+ ...message,
+ messageInfos: messageInfos ? JSON.parse(messageInfos) : null,
+ };
+ }
+
return {
...message,
threadID: convertNonPendingIDToNewSchema(
@@ -69,7 +78,6 @@
function handleAndroidMessage(
message: ParsedAndroidMessage,
- updatesCurrentAsOf: number,
handleIfActive?: (
threadID: string,
texts: { body: string, title: ?string },
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
@@ -7,6 +7,7 @@
convertNonPendingIDToNewSchema,
convertNotificationMessageInfoToNewIDSchema,
} from 'lib/utils/migration-utils.js';
+import { thickThreadIDRegex } from 'lib/utils/validation-utils.js';
import { authoritativeKeyserverID } from '../authoritative-keyserver.js';
@@ -49,6 +50,15 @@
constructor(notification: CoreIOSNotificationData) {
this.remoteNotificationCompleteCallbackCalled = false;
+ const { threadID, messageInfos } = notification;
+
+ if (thickThreadIDRegex.test(threadID)) {
+ this.data = {
+ ...notification,
+ messageInfos: messageInfos ? JSON.parse(messageInfos) : null,
+ };
+ return;
+ }
this.data = {
...notification,
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
@@ -16,10 +16,7 @@
useSetDeviceTokenFanout,
} from 'lib/actions/device-actions.js';
import { saveMessagesActionType } from 'lib/actions/message-actions.js';
-import {
- extractKeyserverIDFromID,
- extractKeyserverIDFromIDOptional,
-} from 'lib/keyserver-conn/keyserver-call-utils.js';
+import { extractKeyserverIDFromIDOptional } from 'lib/keyserver-conn/keyserver-call-utils.js';
import {
deviceTokensSelector,
allUpdatesCurrentAsOfSelector,
@@ -793,15 +790,7 @@
const { messageInfos } = parsedMessage;
this.saveMessageInfos(messageInfos);
-
- const keyserverID = extractKeyserverIDFromID(message.threadID);
- const updateCurrentAsOf = this.props.allUpdatesCurrentAsOf[keyserverID];
-
- handleAndroidMessage(
- parsedMessage,
- updateCurrentAsOf,
- this.handleAndroidNotificationIfActive,
- );
+ handleAndroidMessage(parsedMessage, this.handleAndroidNotificationIfActive);
};
handleAndroidNotificationIfActive = (

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 11:34 AM (7 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2712966
Default Alt Text
D13237.id43894.diff (2 KB)

Event Timeline