Conversation
- Update openiap-versions.json (gql: 1.3.12, apple: 1.3.10, google: 1.3.22) - Regenerate Dart types with new cross-platform offer types - Add _parseSubscriptionOffers helper to convert legacy offer details - Add subscriptionOffers field to ProductSubscriptionAndroid parsing - Update test to include required subscriptionOffers field Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (25)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 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 |
Summary of ChangesHello @hyochan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #608 +/- ##
==========================================
+ Coverage 67.01% 67.15% +0.13%
==========================================
Files 7 7
Lines 1419 1440 +21
==========================================
+ Hits 951 967 +16
- Misses 468 473 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request synchronizes with openiap v1.3.12, introducing new cross-platform DiscountOffer and SubscriptionOffer types to unify in-app purchase offers across iOS and Android. The changes are well-structured, including a new helper function to parse legacy Android offers and updates to product types and tests. My review identified a few opportunities for improvement. The new _parseSubscriptionOffers helper in lib/helpers.dart could be refactored for better readability and to reduce duplication. Additionally, in the auto-generated lib/types.dart, I've noted that the fromJson factories for enums could be simplified, and some toJson methods contain redundant list serialization logic, which could be improved in the code generator. Overall, these changes are a positive step towards a more unified and maintainable API.
| factory DiscountOfferType.fromJson(String value) { | ||
| switch (value) { | ||
| case 'introductory': | ||
| case 'INTRODUCTORY': | ||
| case 'Introductory': | ||
| return DiscountOfferType.Introductory; | ||
| case 'promotional': | ||
| case 'PROMOTIONAL': | ||
| case 'Promotional': | ||
| return DiscountOfferType.Promotional; | ||
| case 'one-time': | ||
| case 'ONE_TIME': | ||
| case 'OneTime': | ||
| return DiscountOfferType.OneTime; | ||
| } | ||
| throw ArgumentError('Unknown DiscountOfferType value: $value'); | ||
| } |
There was a problem hiding this comment.
The fromJson factory method is a bit verbose. It can be simplified by converting the input value to a consistent format (e.g., lowercase and replacing underscores with hyphens) before the switch statement. This would reduce the number of case labels and make the code more maintainable.
Since this is an auto-generated file, this feedback applies to the script that generates this code.
factory DiscountOfferType.fromJson(String value) {
final lowerCaseValue = value.toLowerCase().replaceAll('_', '-');
switch (lowerCaseValue) {
case 'introductory':
return DiscountOfferType.Introductory;
case 'promotional':
return DiscountOfferType.Promotional;
case 'one-time':
return DiscountOfferType.OneTime;
}
throw ArgumentError('Unknown DiscountOfferType value: $value');
}There was a problem hiding this comment.
Fixed in commit 96329b6.
The code generator now normalizes the input value before the switch statement:
factory DiscountOfferType.fromJson(String value) {
final normalized = value.toLowerCase().replaceAll('_', '-');
switch (normalized) {
case 'introductory':
return DiscountOfferType.Introductory;
case 'promotional':
return DiscountOfferType.Promotional;
case 'one-time':
return DiscountOfferType.OneTime;
}
throw ArgumentError('Unknown DiscountOfferType value: $value');
}This applies to all enums in the generated file. Thanks for the feedback!
- Combine duplicate pricingPhaseList.isNotEmpty checks - Remove redundant priceAmountMicros parsing - Use final for type declaration (no reassignment needed) - Remove redundant else-if branch for offer type determination Addresses Gemini code review feedback on PR #608. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add comprehensive test suite for SubscriptionOffer, DiscountOffer types - Update subscription_flow_screen to display standardized offers - Update all_products_screen to show discount offer count badge - Update docs/api/types.md with standardized offer documentation - Update llms.txt and llms-full.txt with new type definitions New test coverage for: - DiscountOffer serialization/deserialization - SubscriptionOffer serialization (cross-platform, Android, iOS fields) - PaymentMode and DiscountOfferType enums - SubscriptionPeriod and SubscriptionPeriodUnit - Product types with standardized offers Co-Authored-By: Claude Opus 4.5 <[email protected]>
…chaseProps) - Update FlutterIapHelper.swift to use decodeVerifyPurchaseProps - Update FlutterInappPurchasePlugin.swift to call new method - Update subscription-offers.md with standardized offer examples - macOS build now succeeds with OpenIAP apple 1.3.10 Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Fix missing getAvailableItems in horizon flavor. Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add SubscriptionProductReplacementParamsAndroid and SubscriptionReplacementModeAndroid imports - Parse subscriptionProductReplacementParams in requestPurchase method - Pass subscriptionProductReplacementParams to buildRequestPurchaseProps - Add KEY_SUBSCRIPTION_PRODUCT_REPLACEMENT_PARAMS constant This enables item-level subscription replacement (Google Play Billing 8.1.0+) as an alternative to the deprecated replacementModeAndroid. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary
DiscountOfferandSubscriptionOffertypes_parseSubscriptionOffershelper to convert legacy offer detailsdiscountOffersandsubscriptionOffersfields on Product typesChanges
Types (auto-generated from openiap-gql)
DiscountOffertype with cross-platform fieldsSubscriptionOffertype with cross-platform fieldsAndroid/IOSsuffixeslib/helpers.dart
_parseSubscriptionOffersfunction to convert legacyProductSubscriptionAndroidOfferDetailsto newSubscriptionOffertypeProductSubscriptionAndroidparsing to includesubscriptionOffersfieldtest/types_platform_test.dart
subscriptionOffersfieldTest plan
flutter analyzepasses (no issues found)flutter testpasses (176 tests)🤖 Generated with Claude Code