feat(RevenueCatUI): add presentation-session state store (PWENG-57)#3660
feat(RevenueCatUI): add presentation-session state store (PWENG-57)#3660AlvaroBrey wants to merge 3 commits into
Conversation
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3925c0f. Configure here.
| _workflowState.value = null | ||
| if (isNewWorkflowImpression) { | ||
| workflowTraceId = UUID.randomUUID().toString() | ||
| // Fresh presentation: start the shared store empty; each step registers its declarations as it builds. |
There was a problem hiding this comment.
Standalone paywall store recreated
Medium Severity
For non-workflow component paywalls, updatePaywallState rebuilds state through calculateState without reusing the existing PaywallStateStore. toComponentsPaywallState then allocates a new store seeded only from declarations, so presentation-session values are lost on color changes and other full state refreshes even though locale-only updates keep the same Components instance.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3925c0f. Configure here.
There was a problem hiding this comment.
Fixed in a932631. The standalone path now reuses one PaywallStateStore (a ViewModel-owned standaloneStateStore, lazily created in updatePaywallState) across full state refreshes like color changes, instead of minting a fresh store each time via toComponentsPaywallState. It is tied to the ViewModel lifetime, so state still resets when the paywall is presented again, matching the workflow-shared store and iOS (@StateObject). Note this was latent in this PR since nothing reads or writes the store until the component wiring lands (Phase 1), but fixing the lifecycle now keeps it correct.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alvarobrey/pweng-57-data-layer #3660 +/- ##
===============================================================
Coverage 80.31% 80.31%
===============================================================
Files 384 384
Lines 15729 15729
Branches 2200 2200
===============================================================
Hits 12633 12633
Misses 2218 2218
Partials 878 878 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



PaywallStateStore, the presentation-session store seeded from the declared state defaults.