Skip to content

[Conditional Configurability][4] Add unsupported condition validation to trigger fallback paywall#3113

Merged
vegaro merged 5 commits into
cesar/conditional-configurabilityfrom
cesar/pw-175-conditional-configurability-v0
Feb 19, 2026
Merged

[Conditional Configurability][4] Add unsupported condition validation to trigger fallback paywall#3113
vegaro merged 5 commits into
cesar/conditional-configurabilityfrom
cesar/pw-175-conditional-configurability-v0

Conversation

@vegaro

@vegaro vegaro commented Feb 17, 2026

Copy link
Copy Markdown
Member

Motivation

When a paywall uses condition types that this SDK version doesn't understand (e.g., conditions added in a newer backend version), the SDK should gracefully fall back to the default paywall rather than rendering incorrectly.

Description

  • Adds UnsupportedCondition validation in toPresentedOverrides. If any override contains an Unsupported condition, it produces a PaywallValidationError
  • Adds PaywallValidationError.UnsupportedCondition error type with descriptive error string

@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-175-conditional-configurability-v0 branch from 4071045 to acdeaf9 Compare February 17, 2026 16:03
@vegaro vegaro force-pushed the cesar/pw-171-remaining-v0-conditions branch from 56b5031 to 8fa05ed Compare February 17, 2026 16:04
@vegaro vegaro changed the title [PW-175] Add unsupported condition validation to trigger fallback paywall [Conditional Configurability][4] Add unsupported condition validation to trigger fallback paywall Feb 17, 2026
@vegaro vegaro force-pushed the cesar/pw-171-remaining-v0-conditions branch from 8fa05ed to 3607d07 Compare February 17, 2026 16:16
@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch 2 times, most recently from c865ed3 to 60b19e8 Compare February 17, 2026 16:57
@vegaro vegaro force-pushed the cesar/pw-171-remaining-v0-conditions branch from 3607d07 to 903b0ec Compare February 17, 2026 16:57

vegaro commented Feb 17, 2026

Copy link
Copy Markdown
Member Author

@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch from 60b19e8 to 63353fe Compare February 18, 2026 10:50
@vegaro vegaro force-pushed the cesar/pw-171-remaining-v0-conditions branch from 903b0ec to 48cd554 Compare February 18, 2026 10:50
@vegaro vegaro marked this pull request as ready for review February 18, 2026 10:54
@vegaro vegaro requested a review from facumenzella February 18, 2026 10:55
@vegaro vegaro force-pushed the cesar/pw-171-remaining-v0-conditions branch from 48cd554 to 88e257e Compare February 18, 2026 15:31
@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch 2 times, most recently from 3073f26 to d026dce Compare February 18, 2026 15:34
@vegaro vegaro force-pushed the cesar/pw-171-remaining-v0-conditions branch from 88e257e to 2020bc1 Compare February 18, 2026 15:34
@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch from d026dce to a78ec8c Compare February 18, 2026 15:36
@vegaro vegaro force-pushed the cesar/pw-171-remaining-v0-conditions branch 2 times, most recently from 082e975 to 72b2a6b Compare February 18, 2026 15:49
@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch from a78ec8c to 2c9d8df Compare February 18, 2026 15:49

@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.

Hey! Quick note - the tests don't compile for me. See inline comment below.

@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.

Hey! Quick heads up - the tests don't compile for me.

@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch from 2c9d8df to b4e7c82 Compare February 18, 2026 16:14
@vegaro vegaro force-pushed the cesar/pw-171-remaining-v0-conditions branch from 72b2a6b to 1d0e5b1 Compare February 18, 2026 16:14
@vegaro vegaro requested a review from facumenzella February 18, 2026 16:31
Base automatically changed from cesar/pw-171-remaining-v0-conditions to cesar/conditional-configurability February 18, 2026 16:35
facumenzella

This comment was marked as spam.

customVariables: Map<String, CustomVariableValue>,
): Boolean {
val variableValue = customVariables[variable] ?: return operator == ComponentOverride.EqualityOperator.NOT_EQUALS
val matches = matchesValue(variableValue)

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.

Using toDouble() and == for comparison could cause precision issues with large integers and may behave differently than iOS. Worth checking parity with purchases-ios.

@emerge-tools

emerge-tools Bot commented Feb 18, 2026

Copy link
Copy Markdown

📸 Snapshot Test

571 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
0 0 0 0 314 0 N/A
TestPurchasesUIAndroidCompatibility Paparazzi
com.revenuecat.testpurchasesuiandroidcompatibility.paparazzi
0 0 0 0 257 0 N/A

🛸 Powered by Emerge Tools

@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 looks good. I want to test the whole thing once it gets pilled up in one branch. Awesome work @vegaro

@codecov

codecov Bot commented Feb 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.22%. Comparing base (b583bb3) to head (d983d64).
⚠️ Report is 1 commits behind head on cesar/conditional-configurability.

Additional details and impacted files
@@                        Coverage Diff                         @@
##           cesar/conditional-configurability    #3113   +/-   ##
==================================================================
  Coverage                              79.22%   79.22%           
==================================================================
  Files                                    347      347           
  Lines                                  13948    13948           
  Branches                                1893     1893           
==================================================================
  Hits                                   11050    11050           
  Misses                                  2112     2112           
  Partials                                 786      786           

☔ 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.

@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch from f4dfbe2 to f599ef3 Compare February 19, 2026 10:21
@vegaro vegaro changed the base branch from cesar/conditional-configurability to graphite-base/3113 February 19, 2026 11:57
@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch from 1765a5c to 4d767ae Compare February 19, 2026 11:57
@vegaro vegaro force-pushed the graphite-base/3113 branch from 114c8c1 to 34d0953 Compare February 19, 2026 11:57
@vegaro vegaro changed the base branch from graphite-base/3113 to main February 19, 2026 11:57
@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch from 4d767ae to 6d4b836 Compare February 19, 2026 11:58
vegaro and others added 5 commits February 19, 2026 12:59
When any component override contains a Condition.Unsupported (an
unrecognized condition type), the paywall now fails validation and
falls back to the default legacy paywall. This ensures developers
cannot ship paywalls with conditions the SDK cannot evaluate, which
could result in incorrect visibility states.

- Add UnsupportedCondition to PaywallValidationError
- Validate conditions in toPresentedOverrides, failing early on Unsupported
- Add unit tests: unsupported condition triggers fallback, recognized
  conditions render normally

Co-authored-by: Cursor <cursoragent@cursor.com>
@vegaro vegaro force-pushed the cesar/pw-175-conditional-configurability-v0 branch from 6d4b836 to d983d64 Compare February 19, 2026 11:59
@vegaro vegaro added this pull request to the merge queue Feb 19, 2026
@vegaro vegaro removed this pull request from the merge queue due to a manual request Feb 19, 2026
@vegaro vegaro changed the base branch from main to cesar/conditional-configurability February 19, 2026 15:06
@vegaro vegaro merged commit a5d3f1e into cesar/conditional-configurability Feb 19, 2026
28 checks passed
@vegaro vegaro deleted the cesar/pw-175-conditional-configurability-v0 branch February 19, 2026 15:06
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