Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paywalls: decode empty images as null #1398

Conversation

NachoSoto
Copy link
Contributor

Equivalent to RevenueCat/purchases-ios#3195

This fixes issues with paywalls in the backend sending "" as images and the SDK trying to render an empty image and taking space:
Screenshot 2023-10-26 at 12 11 34

@NachoSoto NachoSoto requested a review from a team October 26, 2023 20:08
@NachoSoto NachoSoto force-pushed the nacho/pwl-340-template-3-top-margin-when-the-icon-isnt-present branch from ea90b14 to f0c1565 Compare October 26, 2023 20:15
@Test
fun `test PaywallData properties`() {
val json = loadJSON(PAYWALLDATA_SAMPLE1)

val paywall: PaywallData = Json.decodeFromString(json)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was using Json without the same configuration that OfferingParser has.

@NachoSoto NachoSoto force-pushed the nacho/pwl-340-template-3-top-margin-when-the-icon-isnt-present branch from f0c1565 to b9bf98e Compare October 26, 2023 20:53
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (26d5832) 84.46% compared to head (b9bf98e) 84.42%.
Report is 1 commits behind head on paywalls.

Additional details and impacted files
@@             Coverage Diff              @@
##           paywalls    #1398      +/-   ##
============================================
- Coverage     84.46%   84.42%   -0.04%     
============================================
  Files           196      197       +1     
  Lines          6584     6595      +11     
  Branches        957      959       +2     
============================================
+ Hits           5561     5568       +7     
- Misses          655      658       +3     
- Partials        368      369       +1     
Files Coverage Δ
.../com/revenuecat/purchases/common/OfferingParser.kt 87.50% <100.00%> (ø)
...n/com/revenuecat/purchases/paywalls/PaywallData.kt 59.57% <100.00%> (+2.75%) ⬆️
.../purchases/paywalls/EmptyStringToNullSerializer.kt 50.00% <50.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NachoSoto NachoSoto merged commit b1d109f into paywalls Oct 27, 2023
7 checks passed
@NachoSoto NachoSoto deleted the nacho/pwl-340-template-3-top-margin-when-the-icon-isnt-present branch October 27, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants