fix(android): preserve structured notification payloads across the bridge - #1978
Conversation
fadi-george
left a comment
There was a problem hiding this comment.
Thanks for the pr.
I would also add groupedNotifications to AndroidNotificationData interface and OSNotification class property and in the constructor e.g. this.groupedNotifications = receivedEvent.groupedNotifications;
|
Seems a useful property (mostly for click listener) I'll check with the team if that should done for android and other wrapper sdks. |
|
Added groupedNotifications to the Android input type, OSNotification property, and constructor as requested, plus a constructor regression assertion. I also rechecked the Android bridge conversion for nested notifications, action buttons, and null JSON values. Targeted type-aware lint passes with no findings and the Vite+ suite passes all 262 tests. |
fadi-george
left a comment
There was a problem hiding this comment.
The requested groupedNotifications exposure is now included, and the bridge conversions preserve nested notifications, action buttons, and explicit JSON nulls. Tests, scoped source checks, and Android formatting pass.
bec6860 to
d5ef0d4
Compare
fadi-george
left a comment
There was a problem hiding this comment.
Rebased on main and added android_group: 'demo-group', for testing
Description
One Line Summary
Convert action buttons and grouped notifications into bridge-compatible maps instead of passing native objects that turn into null. Retain explicit JSON null values in additionalData.
Compatibility and observable changes
Observable payload correction: actionButtons/groupedNotifications now contain objects rather than null entries, and explicit-null additionalData fields remain present. Consumers relying on the broken omissions should adjust. No method signatures or native dependency versions change.
Details
Motivation
The source audit reproduced the failure paths described below. This PR contains only the associated fix; unrelated audit changes are in separate PRs.
Scope
android/src/main/java/com/onesignal/rnonesignalandroid/RNUtils.javaTesting
Six compiled Java serialization cases using actual RNUtils methods, org.json, and native/bridge doubles; three reproduce baseline data loss and all pass fixed.
Each code/tooling fix was also applied independently to upstream commit
a70312207cf094ac361eaa9196c317acb175c2cdand passed its targeted external actual-source diagnostics. Documentation snippets were checked separately. Native diagnostic harnesses use bridge/SDK doubles and are not an end-to-end push test.On the combined audit branch:
vp check: formatting, lint and type checks pass; native Spotless check passes.No checked-in test files were added or modified; regression evidence comes from external diagnostic harnesses and the existing suite. No physical-device, live notification delivery, Appium/BrowserStack, or release-workflow execution is claimed. The no-location example's stale native lock was updated locally to resolve the current SDK for verification; generated locks are not part of this PR.
Checklist