feat(RevenueCatUI): add presentation-session PaywallStateStore#6992
Conversation
8d8b1b6 to
7cfbf22
Compare
0674d2b to
0c86528
Compare
7cfbf22 to
4452645
Compare
0c86528 to
39f9c9d
Compare
94d0f54 to
e9d5227
Compare
7f8bbde to
d8a13a3
Compare
4 builds increased size
RevenueCat 1.0 (1)
|
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 41.5 kB |
| Code Signature | ⬆️ 2.2 kB |
| 📝 RevenueCatUI.PaywallStateStore.PaywallStateStore | ⬆️ 1.5 kB |
| DYLD.Exports | ⬆️ 1.1 kB |
| Other | ⬆️ 43.3 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 11.8 kB (0.09%)
Total download size change: ⬆️ 3.7 kB (0.09%)
Largest size changes
| Item | Install Size Change |
|---|---|
| 📝 RevenueCatUI.WorkflowPaywallView._stateStore | ⬆️ 1.7 kB |
| DYLD.String Table | ⬆️ 1.3 kB |
| RevenueCatUI.PaywallsV2View.init(paywallComponents,offering,purch... | ⬆️ 648 B |
| Other | ⬆️ 8.2 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 20.1 kB (0.07%)
Total download size change: ⬆️ 4.8 kB (0.07%)
Largest size changes
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 8.2 kB |
| 📝 RevenueCatUI.WorkflowPaywallView._stateStore | ⬆️ 1.7 kB |
| RevenueCatUI.PaywallsV2View.init(paywallComponents,offering,purch... | ⬆️ 648 B |
| Other | ⬆️ 9.6 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 7.9 kB (0.07%)
Total download size change: ⬆️ 3.4 kB (0.08%)
Largest size changes
| Item | Install Size Change |
|---|---|
| 📝 RevenueCatUI.WorkflowPaywallView._stateStore | ⬆️ 1.6 kB |
| RevenueCatUI.PaywallsV2View.init(paywallComponents,offering,purch... | ⬆️ 648 B |
| Other | ⬆️ 5.6 kB |
🛸 Powered by Emerge Tools
e9d5227 to
f6d7bb2
Compare
d280eac to
ed2da74
Compare
4cb851e to
938ee87
Compare
a6e7599 to
f7ed9f0
Compare
938ee87 to
ca5734a
Compare
f7ed9f0 to
3f9c3cd
Compare
alexrepty
left a comment
There was a problem hiding this comment.
Looks good to me, but the AI comment might be worth a look
3f9c3cd to
7d79357
Compare
ca5734a to
b320e0b
Compare
7d79357 to
81d8a41
Compare
b320e0b to
72653e2
Compare
81d8a41 to
d3dc3f7
Compare
72653e2 to
812ed31
Compare
d3dc3f7 to
1def974
Compare
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 1def974. Configure here.
1def974 to
a3289b7
Compare






Motivation
Phase 0 stack (PWENG-56). Adds the presentation-session state store that holds current state-key values — scoped to the workflow when present, the single paywall otherwise — seeded from declared defaults and reset when the presentation ends.
Spec: https://github.com/RevenueCat/sdk-specs/tree/main/openspec/changes/add-paywall-component-state
Description
Adds the thread-safe
PaywallStateStoreand injects it into the environment atWorkflowPaywallView(shared across screens so state survives navigation) andPaywallsV2View(own store when presented standalone). Writes fromstateUpdatesand component wiring come in later phases.Stack: 4/5 → base
pw-state/3-condition.Note
Low Risk
Foundation-only change: store and environment injection with no purchase/auth paths touched; behavior is gated behind later wiring of reads/writes.
Overview
Introduces
PaywallStateStore, a thread-safe, presentation-scoped holder for declared paywall state keys (defaults, typed writes fromstateUpdates,$valuepayload substitution,reset, and incrementalregisterDeclarations). It publishes SwiftUI changes viaObservableObjectand is exposed as\.paywallStateStorein the environment.WorkflowPaywallViewowns one shared@StateObjectstore for the whole workflow (empty seed for now) and injects it so state can survive step navigation.PaywallsV2Viewseeds a local store fromstateDeclarationswhen standalone, but reuses an inherited store when embedded in a workflow so it does not replace the workflow session store.Unit tests cover seeding, apply/validation/coercion rules, reset, registration, observer notifications, and concurrent access. Wiring
stateUpdatesand feeding state intoConditionContextare explicitly deferred to later stack items.Reviewed by Cursor Bugbot for commit a3289b7. Bugbot is set up for automated code reviews on this repo. Configure here.