Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3514710
D5607.id18349.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D5607.id18349.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
@@ -13,11 +13,10 @@
import { getAPNsNotificationTopic } from './providers';
import { apnPush, fcmPush } from './utils';
-// Returns list of deviceTokens that have been updated
async function rescindPushNotifs(
notifCondition: SQLStatementType,
inputCountCondition?: SQLStatementType,
-): Promise<string[]> {
+) {
const notificationExtractString = `$.${threadSubscriptions.home}`;
const visPermissionExtractString = `$.${threadPermissions.VISIBLE}.value`;
const fetchQuery = SQL`
@@ -41,7 +40,6 @@
const deliveryPromises = {};
const notifInfo = {};
const rescindedIDs = [];
- const receivingDeviceTokens = [];
for (const row of fetchResult) {
const rawDelivery = JSON.parse(row.delivery);
const deliveries = Array.isArray(rawDelivery) ? rawDelivery : [rawDelivery];
@@ -65,7 +63,6 @@
deviceTokens: delivery.iosDeviceTokens,
codeVersion: null,
});
- receivingDeviceTokens.push(...delivery.iosDeviceTokens);
} else if (delivery.androidID) {
// Old Android
const notification = prepareAndroidNotification(
@@ -78,7 +75,6 @@
deviceTokens: delivery.androidDeviceTokens,
codeVersion: null,
});
- receivingDeviceTokens.push(...delivery.androidDeviceTokens);
} else if (delivery.deviceType === 'ios') {
// New iOS
const { iosID, deviceTokens, codeVersion } = delivery;
@@ -93,7 +89,6 @@
deviceTokens,
codeVersion,
});
- receivingDeviceTokens.push(...deviceTokens);
} else if (delivery.deviceType === 'android') {
// New Android
const { deviceTokens, codeVersion } = delivery;
@@ -107,7 +102,6 @@
deviceTokens,
codeVersion,
});
- receivingDeviceTokens.push(...deviceTokens);
}
}
rescindedIDs.push(row.id);
@@ -158,8 +152,6 @@
`;
await dbQuery(insertQuery);
}
-
- return [...new Set(receivingDeviceTokens)];
}
function prepareIOSNotification(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 6:16 AM (18 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692908
Default Alt Text
D5607.id18349.diff (2 KB)
Attached To
Mode
D5607: [keyserver] Stop returning set of `deviceToken`s in `rescindPushNotifs(...)`
Attached
Detach File
Event Timeline
Log In to Comment