Display IAP discounts#641
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe PR adds lifetime promotional discount support across the IAP flow. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@presentation/src/playstoreiap/java/org/cryptomator/presentation/service/IapBillingService.kt`:
- Around line 179-180: The yearly subscription price is currently taken from the
first pricing phase in IapBillingService’s offer handling, which can pick up a
trial or introductory phase instead of the recurring cost. Update the price
extraction in the subscription details mapping to use the recurring/base pricing
phase from details.subscriptionOfferDetails and its pricingPhases rather than
the first entry, so the “Yearly Subscription” label reflects the actual
repeating price.
- Around line 157-165: The ProductInfo mapping in IapBillingService should not
create a lifetime entry with an empty base price when only a promotional offer
is present; update the logic around the baseOffer/promoOffer handling to either
fall back to a non-empty offer price or only attach discount metadata when a
valid base offer exists. Also fix the subscription pricing lookup in the same
service by changing the first-phase selection to explicitly choose the recurring
pricing phase instead of blindly using the first phase, so the displayed
subscription price reflects the actual recurring charge.
In
`@presentation/src/test/java/org/cryptomator/presentation/service/ProductInfoTest.kt`:
- Around line 82-91: The null-path test for resolveProductPrices only verifies
lifetimeDiscountPrice, so update the ProductInfoTest cases that cover
no-discount behavior to also assert lifetimeDiscountPercent and
lifetimeDiscountEndTimeMillis are null. Use the resolveProductPrices result in
these tests to fully lock the mapping contract for all lifetime discount fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5294b373-be47-40f5-9063-5c6fed9a81cc
📒 Files selected for processing (6)
presentation/src/main/java/org/cryptomator/presentation/service/ProductInfo.ktpresentation/src/main/java/org/cryptomator/presentation/ui/layout/LicenseContentViewBinder.ktpresentation/src/main/res/layout/view_license_check_content.xmlpresentation/src/main/res/values/strings.xmlpresentation/src/playstoreiap/java/org/cryptomator/presentation/service/IapBillingService.ktpresentation/src/test/java/org/cryptomator/presentation/service/ProductInfoTest.kt
No description provided.