Skip to content

feat(RevenueCatUI): evaluate state conditions in the override resolver (PWENG-57)#3661

Open
AlvaroBrey wants to merge 2 commits into
alvarobrey/pweng-57-state-storefrom
alvarobrey/pweng-57-resolver
Open

feat(RevenueCatUI): evaluate state conditions in the override resolver (PWENG-57)#3661
AlvaroBrey wants to merge 2 commits into
alvarobrey/pweng-57-state-storefrom
alvarobrey/pweng-57-resolver

Conversation

@AlvaroBrey

@AlvaroBrey AlvaroBrey commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Threads the store into the override resolution pipeline. ConditionContext carries a stateReader: (String) -> JsonPrimitive? lambda; Condition.State.evaluate calls it and checks the result with the declared operator. Because reads happen inside each component's derivedStateOf block, Compose tracks per-key subscriptions automatically — only components whose conditions reference the changed key re-evaluate.


Note

Medium Risk
Changes which paywall partials render when state conditions are present; incorrect matching or wiring could show wrong UI, but scope is localized to override resolution with broad test coverage.

Overview
State-based component overrides now participate in override resolution instead of being ignored. ConditionContext gains a stateReader lambda (default: no values) so callers can supply paywall state keyed by name; ComponentOverride.Condition.State reads the current value and applies equals / not equals using the same style of matching as variable conditions (strings, booleans, numbers with epsilon).

Overrides do not apply when the key is missing from both live state and defaults. NOT_EQUALS also does not apply for undeclared keys. Parameterized tests cover booleans, strings, numeric coercion, defaults vs stored values, and undeclared-key behavior.

Reviewed by Cursor Bugbot for commit 7924dc1. Bugbot is set up for automated code reviews on this repo. Configure here.

AlvaroBrey commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

@AlvaroBrey AlvaroBrey self-assigned this Jun 26, 2026
@AlvaroBrey AlvaroBrey changed the title feat(RevenueCatUI): evaluate state conditions in the override resolver feat(RevenueCatUI): evaluate state conditions in the override resolver (PWENG-57) Jun 26, 2026
@AlvaroBrey

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5500d42. Configure here.

@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from 5500d42 to c7fa19c Compare June 26, 2026 08:16
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from a932631 to d4d7399 Compare June 29, 2026 10:36
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from c7fa19c to 1d7720c Compare June 29, 2026 10:36
@emerge-tools

emerge-tools Bot commented Jun 29, 2026

Copy link
Copy Markdown

📸 Snapshot Test

593 unchanged

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

🛸 Powered by Emerge Tools

@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch 2 times, most recently from 1c15d31 to fd18a34 Compare June 29, 2026 13:44
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.48%. Comparing base (e04c671) to head (7924dc1).

Additional details and impacted files
@@                       Coverage Diff                        @@
##           alvarobrey/pweng-57-state-store    #3661   +/-   ##
================================================================
  Coverage                            80.48%   80.48%           
================================================================
  Files                                  403      403           
  Lines                                16717    16717           
  Branches                              2386     2386           
================================================================
  Hits                                 13455    13455           
  Misses                                2322     2322           
  Partials                               940      940           

☔ View full report in Codecov by Harness.
📢 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.

@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from fd18a34 to abf2497 Compare June 29, 2026 14:54
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from 3eebd7d to 3cb75e6 Compare June 29, 2026 14:54
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch 3 times, most recently from 92cb005 to 287498f Compare June 30, 2026 10:27
@AlvaroBrey AlvaroBrey marked this pull request as ready for review June 30, 2026 10:46
@AlvaroBrey AlvaroBrey requested a review from a team as a code owner June 30, 2026 10:46
@AlvaroBrey AlvaroBrey requested review from a team and MonikaMateska and removed request for a team June 30, 2026 10:46
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from 5827123 to a5cf50f Compare July 1, 2026 13:14
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from 287498f to a51ae6b Compare July 1, 2026 13:14
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch 3 times, most recently from 7875cf2 to 447c5f0 Compare July 1, 2026 13:46
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from be9d0f7 to eeb9508 Compare July 1, 2026 13:46
@AlvaroBrey

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 447c5f0. Configure here.

@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from eeb9508 to f733bd7 Compare July 1, 2026 16:44
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from 447c5f0 to 13c315c Compare July 1, 2026 16:44
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from f733bd7 to 3d98289 Compare July 1, 2026 19:05
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch 2 times, most recently from 776f015 to 3685a78 Compare July 1, 2026 19:26
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from bca6976 to df99d4f Compare July 2, 2026 07:21
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from 3685a78 to 26892a7 Compare July 2, 2026 07:21
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from df99d4f to 375a5f2 Compare July 2, 2026 07:43
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from 26892a7 to 196d178 Compare July 2, 2026 07:43
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from 375a5f2 to cb01277 Compare July 3, 2026 10:14
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from 196d178 to 4eab460 Compare July 3, 2026 10:14
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from cb01277 to dee70ca Compare July 3, 2026 13:40
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from 4eab460 to 0a3bab0 Compare July 3, 2026 13:40
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from dee70ca to 9c51ba7 Compare July 6, 2026 06:18
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from 0a3bab0 to 19e96e5 Compare July 6, 2026 06:18
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-state-store branch from 9c51ba7 to e04c671 Compare July 6, 2026 13:58
@AlvaroBrey AlvaroBrey force-pushed the alvarobrey/pweng-57-resolver branch from 19e96e5 to 7924dc1 Compare July 6, 2026 13:58
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.

1 participant