Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3513410
D5606.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5606.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5606: [native] Don't skip `updateBadgeCount` for `deviceTokens` handled by `rescindPushNotifs`
Attached
Detach File
Event Timeline
Log In to Comment