The context for this issue is here: https://linear.app/comm/issue/ENG-4146/navigation-to-thread-after-tapping-notification-is-broken-on-android. RemoteMessage instance caches its serialized form. Therefore even if we change in-memory data and display
correct unencrypted notification, when we pass RemoteMessage instance to JS via Intent we use cached serialized encrypted notification. Therefore we have to manually serialize unencrypted notification before sending it to JS.
Details
Details
Before applying this differential after tapping notification user will not be navigated to the correct thread. After applying this differential this will be fixed.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- marcin/eng-4146
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
| native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java | ||
|---|---|---|
| 263–265 ↗ | (On Diff #27857) | It seems like Bundle has a constructor taking another bundle https://developer.android.com/reference/android/os/Bundle#Bundle(android.os.Bundle). Can we use it, or would it have the same issue? |
| native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java | ||
|---|---|---|
| 263–265 ↗ | (On Diff #27857) | message.getData() returns HashMap<String, String> not a Bundle. There is not API to construct a Bundle from a HashMap<String, String> directly, so we can't implement it this way. |
| native/android/app/src/main/java/app/comm/android/notifications/CommNotificationsHandler.java | ||
|---|---|---|
| 263–265 ↗ | (On Diff #27857) | Ok, makes sense! I was looking at Message class where getData returns Bundle... but for Remote one it isn't the case. |