HomePhabricator
Diffusion Comm de7898f380b1

[native] Don't skip `updateBadgeCount` for `deviceTokens` handled by…

Description

[native] Don't skip updateBadgeCount for deviceTokens handled by rescindPushNotifs

Summary:
Context: https://linear.app/comm/issue/ENG-2078/notification-rescinds-dont-appear-to-be-working-as-expected

In rescindAndUpdateBadgeCounts we were previously skipping updateBadgeCount for deviceTokens "handled" by rescindPushNotifs. I haven't dug too deeply into the git history yet, but my hunch is that this was because rescindPushNotifs previously handled updating the badge count by including the badge entry in the APS dictionary.

However, the badge entry in the APS dictionary of the rescind (background) notif isn't updating the badge count (at least anymore). We have a separate alert-type notification that handles updating the badge count.

This alert notification is already being sent for the "mark as unread" and "mark as read" actions, but isn't being sent when a thread is marked as read after being focused (because that results in a rescind as well that excludes the deviceToken from being handled by updateBadgeCount).

Because rescinding and updating badge count must always happen separately, there's no reason for a rescind to affect whether a badge count update notif is sent. This diff removes the deviceToken exclusion behavior from rescindAndUpdateBadgeCounts and updates updateBadgeCount to remove the (now irrelevant) excludeDeviceTokens argument.


Will handle updating rescindPushNotifs in next diff.

Test Plan:
Video of things behaving as expected (you can see old behavior on Linear issue):

Reviewers: tomek, marcin, varun, ginsu, rohan, ashoat

Reviewed By: ashoat

Subscribers: ashoat, abosh

Differential Revision: https://phab.comm.dev/D5606