Skip to content

[Conditional Configurability][1] Add new condition types for conditional configurability#3110

Merged
vegaro merged 1 commit into
cesar/conditional-configurabilityfrom
cesar/pw-169-android-data-layer-new-condition-types-serialization
Feb 18, 2026
Merged

[Conditional Configurability][1] Add new condition types for conditional configurability#3110
vegaro merged 1 commit into
cesar/conditional-configurabilityfrom
cesar/pw-169-android-data-layer-new-condition-types-serialization

Conversation

@vegaro

@vegaro vegaro commented Feb 17, 2026

Copy link
Copy Markdown
Member

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)

@vegaro vegaro requested a review from a team as a February 17, 2026 15:58
@vegaro vegaro marked this pull request as draft February 17, 2026 16:01
@vegaro vegaro force-pushed the cesar/pw-169-android-data-layer-new-condition-types-serialization branch from 61daaea to a1b6ae1 Compare February 17, 2026 16:04
@vegaro vegaro force-pushed the cesar/conditional-configurability branch from 456562e to c3151dd Compare February 17, 2026 16:04
@vegaro vegaro changed the title [PW-169] Add new V0 condition types for conditional configurability [Conditional Configurability] Add new condition types for conditional configurability Feb 17, 2026
@vegaro vegaro changed the title [Conditional Configurability] Add new condition types for conditional configurability [Conditional Configurability][1] Add new condition types for conditional configurability Feb 17, 2026
@vegaro vegaro force-pushed the cesar/pw-169-android-data-layer-new-condition-types-serialization branch from a1b6ae1 to 5cd98a4 Compare February 17, 2026 16:16
@vegaro vegaro force-pushed the cesar/pw-169-android-data-layer-new-condition-types-serialization branch from 5cd98a4 to db3ef8d Compare February 17, 2026 16:57

vegaro commented Feb 17, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov

codecov Bot commented Feb 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.46939% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.19%. Comparing base (c3151dd) to head (db3ef8d).

Files with missing lines Patch % Lines
...es/paywalls/components/common/ComponentOverride.kt 73.46% 6 Missing and 7 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}

@OptIn(InternalRevenueCatAPI::class)
internal object ConditionSerializer : KSerializer<Condition> {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am using this custom Serializer to be resilient to changes. If something changes in the response we go to Unsupported.

@vegaro vegaro marked this pull request as ready for review February 18, 2026 09:53
@vegaro vegaro requested a review from facumenzella February 18, 2026 09:53
@vegaro vegaro force-pushed the cesar/pw-169-android-data-layer-new-condition-types-serialization branch from db3ef8d to aed71b5 Compare February 18, 2026 10:50

@facumenzella facumenzella left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Comment thread fastlane/README.md
Comment thread feature/admob/build.gradle.kts
@vegaro vegaro changed the base branch from cesar/conditional-configurability to main February 18, 2026 14:40

@facumenzella facumenzella left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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>
@vegaro vegaro force-pushed the cesar/pw-169-android-data-layer-new-condition-types-serialization branch from aed71b5 to ed770a3 Compare February 18, 2026 15:30
@vegaro vegaro changed the base branch from main to cesar/conditional-configurability February 18, 2026 15:31
@vegaro vegaro merged commit 9f9641b into cesar/conditional-configurability Feb 18, 2026
3 of 4 checks passed
@vegaro vegaro deleted the cesar/pw-169-android-data-layer-new-condition-types-serialization branch February 18, 2026 15:32
vegaro added a commit that referenced this pull request Feb 19, 2026
…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>
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.

2 participants