Implement thick thread badge updates and rescinds handling in native notifs code
Summary:
This differential implements badge count and rescind handling in the NSE/CommNotificationsHandler.
Notes on rescinds:
- The difference between thick thread rescind and thin thread rescind is presence of notificationId/rescindID property.
- Thin thread rescinds remove single notification while thick thread rescinds remove all notification for particular therad.
- In future we want thin thread rescinds work like thick thread rescinds.
Notes on badge count:
- Badge count value is calculated based on the sum of unread counts for each keyserver and the size of unread thick threads set.
- Visual notifs and badge updates add relevant threadID to the unread thick threads set. Rescinds remove threadID from unread thick threads set.
Test Plan:
- Apply this patch: https://gist.github.com/marcinwasowicz/3e766542268c0840626ece5af61cc5db
- Build native app, log in to two different users on native and web, background native app.
- Send text message from web to native.
- Ensure the following happens:
- Keyserver based notif is delivered, badge count is 1.
- Thread creation and text message thick thread notifs are delivered, badge count is 2.
- After a little while thick thread notifs are removed, keyserver notif stays and badge count is 1 again.
Backgrounding the app is necessary since the JS code cannot update badge count with thick threads yet. This will be the matter of next diffs.
Reviewers: tomek, kamil, bartek
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D13167