Implement displaying error message notification for cases that might cause empty notification on Android
Summary:
Investigation of https://linear.app/comm/issue/ENG-4525/empty-notification-on-android hasn't led to reliable reproduction yet. Nevertheless there are potential explanations of how this bug might have occurred. This differential introduces changes that will result in error message being displayed as notification in case a path leading to empty notification occurs. Changes in this differential are based on the algorithm described here: https://linear.app/comm/issue/ENG-4525/empty-notification-on-android#comment-2aae9fa4
- One thing to note is that our current knowledge suggests that none of the reasons examined by the algorithm linked above might be the actual cause for the issue. It is possible that the OS simply displays group summary instead of the notification group. If that is the case we should see debugging data instead of empty notifications.
- We don't have a theory as to why the OS replaces group with the content of the summary but perhaps this debugging info will help us discover some pattern.
- Eventually if we don't have an explanation after landing this differential but we confirm that the OS indeed sometimes just replaces the group with the summary the best thing to do is to populate the summary with informative and user-friendly content that can be released to public users.
Test Plan:
- Comment notificationManager.cancel(threadID, threadID.hashCode()); line.
- Send some notifs, then some rescinds
- Ensure that notification summary with title and body is present but there are no notif ids in the body.
Then keeping those changes:
- Comment removeNotificationFromGroupSummary(threadID, rescindID, notification);
- Again send some notifs then some rescinds.
- Ensure that notification summary with title and body is present and there are notifs ids in the summary body.
Remember to make comm::StaffUtils::isStaffRelease method return true for the testing above.
Reviewers: tomek, atul, ashoat
Reviewed By: tomek, ashoat
Differential Revision: https://phab.comm.dev/D8730