feat(paywalls): add dedicated state condition to component overrides#6991
Conversation
17bb3e1 to
c180d51
Compare
0674d2b to
0c86528
Compare
c180d51 to
440b6ed
Compare
0c86528 to
39f9c9d
Compare
94d0f54 to
e9d5227
Compare
bf4c17e to
1d301b4
Compare
1 build increased size, 3 builds decreased size
RevenueCat 1.0 (1)
|
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 720 B |
| Other | ⬆️ 6.7 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬇️ 11.6 kB (-0.09%)
Total download size change: ⬇️ 5.5 kB (-0.13%)
Largest size changes
| Item | Install Size Change |
|---|---|
| RevenueCat.Array.hash(into) | ⬆️ 5.5 kB |
| RevenueCat.PaywallComponent.ComponentOverride.hash(into) | ⬇️ -4.6 kB |
| RevenueCat.PaywallComponent.CountdownComponent.CountdownComponent | ⬇️ -2.8 kB |
| 🗑 Swift.Array.Array | ⬇️ -2.7 kB |
| RevenueCat.PaywallComponent.VideoComponent.VideoComponent | ⬇️ -2.6 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬇️ 11.2 kB (-0.04%)
Total download size change: ⬇️ 6.7 kB (-0.1%)
Largest size changes
| Item | Install Size Change |
|---|---|
| RevenueCat.Array.hash(into) | ⬆️ 5.5 kB |
| RevenueCat.PaywallComponent.ComponentOverride.hash(into) | ⬇️ -4.6 kB |
| RevenueCat.PaywallComponent.CountdownComponent.CountdownComponent | ⬇️ -2.8 kB |
| 🗑 Swift.Array.Array | ⬇️ -2.7 kB |
| RevenueCat.PaywallComponent.VideoComponent.VideoComponent | ⬇️ -2.6 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬇️ 11.7 kB (-0.1%)
Total download size change: ⬇️ 6.2 kB (-0.14%)
Largest size changes
| Item | Install Size Change |
|---|---|
| RevenueCat.Array.hash(into) | ⬆️ 5.5 kB |
| RevenueCat.PaywallComponent.ComponentOverride.hash(into) | ⬇️ -4.6 kB |
| 🗑 Swift.Array.Array | ⬇️ -3.1 kB |
| RevenueCat.PaywallComponent.CountdownComponent.CountdownComponent | ⬇️ -2.8 kB |
| RevenueCat.PaywallComponent.VideoComponent.VideoComponent | ⬇️ -2.6 kB |
🛸 Powered by Emerge Tools
e9d5227 to
f6d7bb2
Compare
1d301b4 to
907d3da
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 f6d7bb2. Configure here.
f6d7bb2 to
4cb851e
Compare
4cb851e to
938ee87
Compare
907d3da to
9e1cd95
Compare
938ee87 to
ca5734a
Compare
9e1cd95 to
33cab48
Compare
b320e0b to
72653e2
Compare
33cab48 to
39543e1
Compare
📸 Snapshot Test339 unchanged
🛸 Powered by Emerge Tools |
72653e2 to
812ed31
Compare






Checklist
purchases-androidand hybridsMotivation
Phase 0 stack (PWENG-56). Introduces the dedicated
statecondition type in component overrides, joining the existing condition types. A dedicated type (rather than overloadingvariable_condition) gives clean forward-compat: older SDKs decode it as unsupported and fall back to the default paywall.Spec: https://github.com/RevenueCat/sdk-specs/tree/main/openspec/changes/add-paywall-component-state
Description
Adds the
statecase toExtendedCondition(toCondition()→.unsupported,isRuletrue) and thestate_conditionwire type. The resolver switch handles it as non-matching for now (case .state: return false); real evaluation lands in the resolver PR.@_spi(Internal); no public API change.Stack: 3/5 → base
pw-state/2-updates.Note
Low Risk
Internal SPI-only paywall condition plumbing with evaluation disabled (
false); behavior change is limited until the resolver PR lands.Overview
Introduces a
stateextended override condition (state_conditionon the wire:name,operator,value) for state-driven paywalls, separate fromvariable_conditionso older SDKs can treat unknown types as unsupported and degrade safely.ExtendedConditiongains encode/decode,isRule, andtoCondition()→.unsupported; decoding is refactored intodecodeCondition. Paywalls V2evaluateConditionhandles.stateby always returningfalseuntil a follow-up PR implements real resolution.Package.resolveddrops several test-only SPM pins (e.g. FlyingFox, OHHTTPStubs).Tests cover JSON round-trips, malformed payloads →
.unsupported, rule discard underdiscardRules, and forward-compat degradation.Reviewed by Cursor Bugbot for commit 812ed31. Bugbot is set up for automated code reviews on this repo. Configure here.