Page MenuHomePhabricator

D5606.diff
No OneTemporary

D5606.diff

diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js
--- a/keyserver/src/push/send.js
+++ b/keyserver/src/push/send.js
@@ -761,7 +761,6 @@
async function updateBadgeCount(
viewer: Viewer,
source: 'mark_as_unread' | 'mark_as_read' | 'activity_update',
- excludeDeviceTokens: $ReadOnlyArray<string>,
) {
const { userID } = viewer;
@@ -774,11 +773,6 @@
if (viewer.data.cookieID) {
deviceTokenQuery.append(SQL`AND id != ${viewer.cookieID} `);
}
- if (excludeDeviceTokens.length > 0) {
- deviceTokenQuery.append(
- SQL`AND device_token NOT IN (${excludeDeviceTokens}) `,
- );
- }
const [unreadCounts, [deviceTokenResult], [dbID]] = await Promise.all([
getUnreadCounts([userID]),
dbQuery(deviceTokenQuery),
diff --git a/keyserver/src/updaters/activity-updaters.js b/keyserver/src/updaters/activity-updaters.js
--- a/keyserver/src/updaters/activity-updaters.js
+++ b/keyserver/src/updaters/activity-updaters.js
@@ -464,14 +464,14 @@
| 'mark_as_read'
),
) {
- const excludeDeviceTokens = [];
+ const notificationPromises = [];
if (rescindCondition) {
- const handledDeviceTokens = await rescindPushNotifs(rescindCondition);
- excludeDeviceTokens.push(...handledDeviceTokens);
+ notificationPromises.push(rescindPushNotifs(rescindCondition));
}
if (badgeCountUpdateSource) {
- await updateBadgeCount(viewer, badgeCountUpdateSource, excludeDeviceTokens);
+ notificationPromises.push(updateBadgeCount(viewer, badgeCountUpdateSource));
}
+ await Promise.all(notificationPromises);
}
async function shouldResetThreadToUnread(

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 12:20 AM (17 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692940
Default Alt Text
D5606.diff (1 KB)

Event Timeline