customerio / customerio-android

This is the official Customer.io SDK for Android.
MIT License
11 stars 9 forks source link

chore: prevent error thrown when image URL cannot be composed because empty string #338

Closed levibostian closed 1 month ago

levibostian commented 1 month ago

Fixes: https://linear.app/customerio/issue/MBL-308/error-javanetmalformedurlexception-no-protocol-on-receive-rich

Customer shared with us a push that they composed in Fly using the rich push composer, that does not have an image specified in the editor, but a "image" field gets added to the push payload with an empty string. The SDK handled when the "image" property is null, but not empty.

Customer is not experiencing a crash of the app, but they are getting stacktraces reported to them. So, this commit is a chore instead of a fix.

Testing:

github-actions[bot] commented 1 month ago
# 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. --- * java_layout: `spr/main/9a437474 (1715882095)` * kotlin_compose: `spr/main/9a437474 (1715882092)`
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 54.25%. Comparing base (c8cbb12) to head (9322b22).

Files Patch % Lines
...messagingpush/CustomerIOPushNotificationHandler.kt 0.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #338 +/- ## ============================================ - Coverage 54.38% 54.25% -0.13% - Complexity 282 283 +1 ============================================ Files 109 109 Lines 2534 2512 -22 Branches 355 356 +1 ============================================ - Hits 1378 1363 -15 + Misses 1032 1024 -8 - Partials 124 125 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 month ago

Build available to test Version: spr-main-9a437474-SNAPSHOT Repository: https://s01.oss.sonatype.org/content/repositories/snapshots/

github-actions[bot] commented 1 month ago

📏 SDK Binary Size Comparison Report

No changes detected in SDK binary size ✅

levibostian commented 1 month ago

Converting to draft as we may not end up merging this but instead making a change in frontend/backend.

levibostian commented 1 month ago

We made a backend change to fix this issue for the customer so this PR is not needed.

There could still be some value in merging this PR, but that would mean we should make the change on iOS, too. The value in merging is little so I'll close this.