fix: support null handling in nested structures#508
Conversation
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #508 +/- ##
============================================
+ Coverage 52.02% 52.45% +0.43%
- Complexity 318 319 +1
============================================
Files 105 104 -1
Lines 2862 2888 +26
Branches 381 384 +3
============================================
+ Hits 1489 1515 +26
Misses 1259 1259
Partials 114 114 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Build available to test |
|
|
mrehan27
left a comment
There was a problem hiding this comment.
Looks good 👍🏻
We can roll it out after testing the changes on wrapper SDKs.
mahmoud-elmorabea
left a comment
There was a problem hiding this comment.
Approach looks solid! 💯
Just wanted to double check on two main concerns:
- I think we might have missed at least one place using
CustomAttributes, maybe it's worth doing a search for it to make sure we covered all. I only found one though - I cross tested with iOS quickly and it seems like iOS omits the value all together rather than sending it null, but it's not consistent, have we cross checked behavior with iOS?
datapipelines/src/test/java/io/customer/datapipelines/DataPipelinesInteractionTests.kt
Show resolved
Hide resolved
Thats a good callout, I agree with consistency but I also don't want to introduce a breaking change in terms of behavior. For example, currently If we add logic of skipping nulls, then even that current behavior is going to be changed and if anyone has any segments/events driven based on that current behavior, it could break for them |
|
|
## [4.5.6](4.5.5...4.5.6) (2025-04-10) ### Bug Fixes * support null handling in nested structures ([#508](#508)) ([bf6cb1b](bf6cb1b))
## [4.5.6](4.5.5...4.5.6) (2025-04-10) ### Bug Fixes * support null handling in nested structures ([#508](#508)) ([bf6cb1b](bf6cb1b))
## [4.5.6](4.5.5...4.5.6) (2025-04-11) ### Bug Fixes * support null handling in nested structures ([#508](#508)) ([bf6cb1b](bf6cb1b))
closes: MBL-955
Changes
sanitizeNullsForJson()extension to recursively replace allnullvalues withJsonNullinCustomAttributesforMapandListbefore forwarding toanalyticsCustomerIO.instanceto validate end-to-end behaviorMap<String,Any?>so they can cater cases of both,CustomeAttributeandmapof type <string, any?>Sample Code
Crash on
mainbefore this fix: