[Conditional Configurability][1] Add new condition types for conditional configurability#3110
Conversation
61daaea to
a1b6ae1
Compare
456562e to
c3151dd
Compare
a1b6ae1 to
5cd98a4
Compare
5cd98a4 to
db3ef8d
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## cesar/conditional-configurability #3110 +/- ##
=====================================================================
- Coverage 79.22% 79.19% -0.04%
=====================================================================
Files 347 347
Lines 13911 13956 +45
Branches 1884 1896 +12
=====================================================================
+ Hits 11021 11052 +31
- Misses 2109 2114 +5
- Partials 781 790 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| @OptIn(InternalRevenueCatAPI::class) | ||
| internal object ConditionSerializer : KSerializer<Condition> { |
There was a problem hiding this comment.
I am using this custom Serializer to be resilient to changes. If something changes in the response we go to Unsupported.
db3ef8d to
aed71b5
Compare
facumenzella
left a comment
There was a problem hiding this comment.
Nice work on the data layer! One thing to flag:
IntroOffer and PromoOffer now parse operator/value, but shouldApply() in PresentedPartial.kt still only checks the eligibility flag—so conditions like {"type":"intro_offer","operator":"=","value":false} won't behave as expected yet.
I see this is PR 1 of 4 in the stack—is evaluation logic coming in a follow-up, or should it be addressed here?
facumenzella
left a comment
There was a problem hiding this comment.
I think this one makes sense, just that small note
- Add SelectedPackage, Variable, and Package condition types - Extend IntroOffer/PromoOffer from object to data class with optional operator/value - Add EqualityOperator, ArrayOperator enums and ConditionValue sealed type - Update ConditionSerializer with new type mappings - Add placeholder branches in shouldApply() for new types (return false) - Add deserialization tests for all new condition types Co-authored-by: Cursor <cursoragent@cursor.com>
aed71b5 to
ed770a3
Compare
9f9641b
into
cesar/conditional-configurability
…nal configurability (#3110) ### Motivation The conditional configurability V0 feature requires new condition types in the data layer to support dynamic paywall component visibility based on variables, packages, and extended intro/promo offer conditions. ### Description - Adds `Variable`, `Package`, `SelectedPackage` data classes to `ComponentOverride.Condition` sealed interface - Extends `IntroOffer` and `PromoOffer` conditions from simple objects to data classes with `operator` and `value` fields (backwards compatible with legacy format) - Adds `EqualityOperator`, `ArrayOperator`, and `ConditionValue` types for condition evaluation - Updates `ConditionSerializer` to handle new types with fallback to `Unsupported` on parse errors - Comprehensive unit tests for deserialization, backwards compatibility, unknown types, and malformed data **Tasks:** PW-169 (1.1–1.13) Co-authored-by: Cursor <cursoragent@cursor.com>

Motivation
The conditional configurability V0 feature requires new condition types in the data layer to support dynamic paywall component visibility based on variables, packages, and extended intro/promo offer conditions.
Description
Variable,Package,SelectedPackagedata classes toComponentOverride.Conditionsealed interfaceIntroOfferandPromoOfferconditions from simple objects to data classes withoperatorandvaluefields (backwards compatible with legacy format)EqualityOperator,ArrayOperator, andConditionValuetypes for condition evaluationConditionSerializerto handle new types with fallback toUnsupportedon parse errorsTasks: PW-169 (1.1–1.13)