When user receives notification with collapse id in badge only thread it will result in notification with "ENCRYPTED" body. This diff fixes that.
Details
Details
- Prior to this diff every collapsable notif (image, change settings etc.) resulted in ENCRYPTED notifs in a badge-only thread on iOS.
- After this diff the issue is fixed.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- marcin/eng-9185
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
Just wondering, what codepath led to the ENCRYPTED notif? Curious why we saw that instead of Obj-C exception or C++ exception
Comment Actions
The code path flows like this:
- First the keyserver inserts ENCRYPTED body to aps dictionary on encrypted badge only notification: https://github.com/CommE2E/comm/blob/5e6732ede2db1aed9e4f2cb15db249a87e643aa3/keyserver/src/push/crypto.js#L88
- The NSE decrypts notification. There is no body property in decryptedPayload so it does not overwrite the body property that is in aps dictionary: https://github.com/CommE2E/comm/blob/5e6732ede2db1aed9e4f2cb15db249a87e643aa3/native/ios/NotificationService/NotificationService.mm#L679-L687
- Then the NSE sees that this notification has collapse key so it creates local notification that has the same body as the original notification (which is ENCRYPTED): https://github.com/CommE2E/comm/blob/5e6732ede2db1aed9e4f2cb15db249a87e643aa3/native/ios/NotificationService/NotificationService.mm#L251