Skip to content

Fix tabs conditional overrides losing extended conditions#6361

Merged
facumenzella merged 1 commit into
facundo/cocofrom
fix/tabs-extended-conditions
Feb 27, 2026
Merged

Fix tabs conditional overrides losing extended conditions#6361
facumenzella merged 1 commit into
facundo/cocofrom
fix/tabs-extended-conditions

Conversation

@facumenzella

@facumenzella facumenzella commented Feb 26, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve extendedConditions when converting TabsComponent overrides through the synthetic stack in ViewModelFactory
  • avoid downgrading recognized V0 conditions (variable, selected_package) to .unsupported
  • add regression coverage to ensure tabs overrides with recognized extended conditions do not throw PaywallError.unsupportedCondition

Verification

  • swift test --filter ViewModelFactoryBadgeTests

Context

Compared with Android base PR RevenueCat/purchases-android#3117:

  • Android keeps condition types through override evaluation and tests recognized vs unsupported handling.
  • This patch aligns iOS tabs behavior with that pattern.

Note

Medium Risk
Adjusts how TabsComponent overrides are converted for evaluation; mistakes could change paywall visibility/override behavior or trigger unintended fallback via PaywallError.unsupportedCondition. Scope is small and covered by a new regression test.

Overview
Fixes TabsComponent override conversion in ViewModelFactory to preserve extendedConditions when building the synthetic stack used for tabs, instead of downgrading them into legacy conditions.

Adds a regression test ensuring a tabs override using the recognized selectedPackage extended condition does not throw PaywallError.unsupportedCondition, and updates imports to use @_spi(Internal) import RevenueCat where needed.

Written by Cursor Bugbot for commit 575637f. This will update automatically on new commits. Configure here.

@emerge-tools

emerge-tools Bot commented Feb 26, 2026

Copy link
Copy Markdown

3 builds increased size, 1 build had no size change

Name Version Download Change Install Change Approval
RevenueCat
com.revenuecat.PaywallsTester
1.0 (1) 17.5 MB ⬆️ 39.0 kB (0.22%) 62.7 MB ⬆️ 187.2 kB (0.3%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.local-source
1.0 (1) 3.8 MB ⬆️ 26.4 kB (0.7%) 11.4 MB ⬆️ 71.7 kB (0.64%) ⏳ Needs approval
BinarySizeTest
com.revenuecat.binary-size-test.cocoapods
1.0 (1) 5.7 MB ⬆️ 30.6 kB (0.54%) 25.3 MB ⬆️ 113.5 kB (0.45%) ⏳ Needs approval
BinarySizeTest
com.revenuecat.binary-size-test.spm
1.0 (1) 3.3 MB ⬆️ 7 B 10.1 MB - N/A

RevenueCat 1.0 (1)
com.revenuecat.PaywallsTester

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 187.2 kB (0.3%)
Total download size change: ⬆️ 39.0 kB (0.22%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 65.6 kB
RevenueCatUI.VideoComponentViewModel.VideoComponentViewModel ⬆️ 9.8 kB
Code Signature ⬆️ 4.5 kB
DYLD.Exports ⬆️ 4.4 kB
RevenueCatUI.StackComponentViewModel.StackComponentViewModel ⬆️ 856 B
View Treemap

Image of diff

BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source

⚖️ Compare build
📦 Install build
⏱️ Analyze build performance

Total install size change: ⬆️ 71.7 kB (0.64%)
Total download size change: ⬆️ 26.4 kB (0.7%)

Largest size changes

Item Install Size Change
📝 RevenueCatUI.VideoComponentViewModel.styles(state,condition,isEli... ⬆️ 12.2 kB
🗑 RevenueCatUI.VideoComponentViewModel.styles(state,condition,isEli... ⬇️ -9.6 kB
📝 RevenueCatUI.CarouselComponentViewModel.styles(state,condition,is... ⬆️ 6.3 kB
📝 RevenueCatUI.ImageComponentViewModel.styles(state,condition,isEli... ⬆️ 5.9 kB
📝 RevenueCatUI.StackComponentViewModel.styles(state,condition,isEli... ⬆️ 5.7 kB
View Treemap

Image of diff

BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods

⚖️ Compare build
📦 Install build
⏱️ Analyze build performance

Total install size change: ⬆️ 113.5 kB (0.45%)
Total download size change: ⬆️ 30.6 kB (0.54%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 15.9 kB
DYLD.String Table ⬆️ 13.7 kB
📝 RevenueCatUI.VideoComponentViewModel.styles(state,condition,isEli... ⬆️ 10.6 kB
🗑 RevenueCatUI.VideoComponentViewModel.styles(state,condition,isEli... ⬇️ -9.6 kB
RevenueCatUI.Template2View.iconImage ⬆️ 8.1 kB
View Treemap

Image of diff

BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm

No changes to report


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

@facumenzella facumenzella requested a review from vegaro February 26, 2026 13:05
@facumenzella facumenzella marked this pull request as ready for review February 26, 2026 13:07
@facumenzella facumenzella requested a review from a team as a code owner February 26, 2026 13:07
@facumenzella facumenzella merged commit 86431e4 into facundo/coco Feb 27, 2026
12 of 15 checks passed
@facumenzella facumenzella deleted the fix/tabs-extended-conditions branch February 27, 2026 09:05
facumenzella added a commit that referenced this pull request Mar 6, 2026
* [Conditional Configurability][1] Add new condition types for conditional configurability

Add ExtendedCondition enum as @_spi(Internal) to support new condition types
while keeping the public Condition API stable. This includes:

- ExtendedCondition enum with associated values for variableCondition,
  selectedPackageCondition, extended introOffer/promoOffer conditions
- EqualityOperator and ArrayOperator enums for condition evaluation
- ConditionValue enum for type-safe variable values
- ComponentOverride now stores ExtendedCondition internally, exposes
  public Condition via computed property
- Updated PresentedPartials to use ExtendedCondition
- Comprehensive deserialization tests

The public Condition enum remains unchanged as String raw-value to
maintain API stability. New condition types map to .unsupported in
the public API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix CI: Add @_spi(Internal) import to PresentedPartialsTests

The existing test file needs SPI access to use ExtendedCondition
cases after the restructuring for conditional configurability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add missing deserialization error handling tests

Match Android test coverage for edge cases:
- Unknown operator falls back to unsupported
- Wrong field types fall back to unsupported
- Empty JSON object falls back to unsupported
- JSON without type field falls back to unsupported

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix ExtendedCondition decoder to handle missing type field gracefully

The decoder now wraps the entire decoding logic in a do-catch block,
so that empty JSON objects or JSON without a "type" field fall back
to `.unsupported` instead of throwing a keyNotFound error.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* same line

* Add clarifying comment about Condition's unused Codable implementation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add ConditionDeserializationTests.swift to Xcode project

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Simplify ExtendedCondition by removing redundant legacy cases

Normalize legacy intro_offer/promo_offer conditions to their extended form
(operator: .equals, value: true) during deserialization instead of having
separate cases for legacy and extended forms.

This simplifies the enum and evaluation logic while maintaining full
backwards compatibility with legacy JSON.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove redundant Condition suffix from ExtendedCondition cases

Rename for consistency with other cases (.compact, .medium, etc.):
- introOfferCondition → introOffer
- promoOfferCondition → promoOffer
- variableCondition → variable
- selectedPackageCondition → selectedPackage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [Conditional Configurability][2] Implement `selected_package` condition evaluation (#6286)

* [Conditional Configurability][2] Add ConditionContext and evaluation logic

- Add ConditionContext struct for passing evaluation context
- Add buildPartial overload that accepts ConditionContext
- Add shouldApply overload with full condition evaluation
- Add evaluateCondition for all condition types
- Add helper methods for variable, package, and boolean condition evaluation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix availability annotations and CustomVariableValue usage

- Add @available(iOS 15.0, ...) to ConditionContext and related methods
- Fix matchesValue to use CustomVariableValue getters (.stringValue,
  .boolValue, .doubleValue) instead of pattern matching on private enum

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Simplify shouldApply by delegating to iOS 15+ version

The else branch is dead code since Paywalls is iOS 15+ anyway.
This consolidates the condition evaluation logic in one function.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* [Conditional Configurability][3] Implement variable and extended intro/promo condition evaluation (#6287)

* [Conditional Configurability][3] Add condition evaluation tests

Add comprehensive tests for the condition evaluation logic:
- Selected package condition tests (in/not in operators)
- Variable condition tests (string, int, not found)
- Extended intro offer condition tests (equals/not equals)
- Multiple conditions (AND logic) tests
- Unsupported condition tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add missing condition evaluation tests and fix availability

- Add promo offer condition tests with operators
- Add variable boolean, double, and type mismatch tests
- Add intro offer negative test case
- Fix @available annotations for ConditionContext and related methods
- Fix matchesValue to use CustomVariableValue getters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix type-strict variable condition evaluation and remove unrelated files

- Add isString, isNumber, isBool type checking methods to CustomVariableValue
- Update matchesValue to perform type-strict comparison (string != int, etc.)
- Remove accidentally committed PR_6285_review.md and package-lock.json
- Revert unrelated Package.resolved changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* [Conditional Configurability][4] Validate unsupported conditions in toPresentedOverrides (#6288)

* [Conditional Configurability][3] Add condition evaluation tests

Add comprehensive tests for the condition evaluation logic:
- Selected package condition tests (in/not in operators)
- Variable condition tests (string, int, not found)
- Extended intro offer condition tests (equals/not equals)
- Multiple conditions (AND logic) tests
- Unsupported condition tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add missing condition evaluation tests and fix availability

- Add promo offer condition tests with operators
- Add variable boolean, double, and type mismatch tests
- Add intro offer negative test case
- Fix @available annotations for ConditionContext and related methods
- Fix matchesValue to use CustomVariableValue getters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix type-strict variable condition evaluation and remove unrelated files

- Add isString, isNumber, isBool type checking methods to CustomVariableValue
- Update matchesValue to perform type-strict comparison (string != int, etc.)
- Remove accidentally committed PR_6285_review.md and package-lock.json
- Revert unrelated Package.resolved changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [Conditional Configurability][4] Add unsupported condition detection

- Add `PaywallError.unsupportedCondition` case for future fallback support
- Add `containsUnsupportedConditions()` method to detect unsupported conditions
- Add logging string for unsupported condition warning
- Add comprehensive tests for unsupported condition detection

Note: The actual fallback mechanism (throwing and catching at paywall level)
will be implemented in a follow-up PR to avoid cascading changes to all
component ViewModels.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Make CustomVariableValue.number and .bool public

Allow developers to pass numeric and boolean custom variables to paywalls,
enabling condition evaluation based on these types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update API tester to use public .number() and .bool() methods

The CustomVariableValue factory methods .number() and .bool() are now
public. Update the API tester to use these methods directly instead of
using .string() for all values.

Existing test coverage in VariableHandlerV2Tests.swift already covers
these factory methods comprehensively.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Integrate unsupported condition validation into toPresentedOverrides

This matches Android's approach where toPresentedOverrides checks for
unsupported conditions and throws PaywallError.unsupportedCondition,
triggering fallback to the default paywall.

Changes:
- toPresentedOverrides now throws when unsupported conditions are found
- Updated all view model initializers to be throwing
- Updated ViewModelFactory to use try when instantiating view models
- Used try? with fallback for video backgrounds in SwiftUI contexts
- Updated preview code with try!/force_try

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add tests for toPresentedOverrides throwing on unsupported conditions

Add test coverage verifying that toPresentedOverrides throws
PaywallError.unsupportedCondition when any override contains an
unsupported condition type.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [Conditional Configurability][5] PR comments and fallback paywall (#6319)

* Integrate unsupported condition validation into toPresentedOverrides

This matches Android's approach where toPresentedOverrides checks for
unsupported conditions and throws PaywallError.unsupportedCondition,
triggering fallback to the default paywall.

Changes:
- toPresentedOverrides now throws when unsupported conditions are found
- Updated all view model initializers to be throwing
- Updated ViewModelFactory to use try when instantiating view models
- Used try? with fallback for video backgrounds in SwiftUI contexts
- Updated preview code with try!/force_try

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* suggestions

^ Conflicts:
^	RevenueCatUI/Data/CustomPaywallVariables.swift
^	RevenueCatUI/Templates/V2/ViewModelHelpers/PresentedPartials.swift

* internal bool and number

* fallback paywall

* Fix compilation error and SwiftLint violations

- Fix call to renamed method: containsUnsupportedConditions -> hasUnsupportedCondition
- Rename variable 'c' to 'component' to satisfy identifier_name rule
- Add swiftlint:disable for cyclomatic_complexity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove accidental .package.resolved file

* Remove extra blank lines

---------

Co-authored-by: Facundo Menzella <facumenzella@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* Add non-throwing factory for video backgrounds

- Add VideoComponentViewModel.forBackground() for video backgrounds
- Video backgrounds don't have overrides, so no validation needed
- Remove try? fallback pattern in DisplayableColor.swift
- Consistent with other components: early validation, non-throwing where safe

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Cesar de la Vega <664544+vegaro@users.noreply.github.com>

* [bug-bash] Fix selectedPackage conditional visibility not working

The selectedPackage condition was never evaluated correctly because
components were calling buildPartial without passing ConditionContext.
This meant selectedPackageId was always nil during condition evaluation.

Updated all component ViewModels to:
- Accept selectedPackageId parameter in their styles() method
- Create ConditionContext with the selected package ID
- Pass conditionContext to buildPartial()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [bug-bash] Add warning log for unrecognized paywall condition types

Developers will now see a warning when the SDK encounters a condition type
it doesn't recognize, helping them identify when they need to update the SDK.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [bug-bash] Add support for multiple_intro_offers condition type

This condition is supported in Android. On iOS, it always evaluates to false
since iOS does not support multiple intro offers. Adding this prevents the
paywall from falling back to the default when this condition is present.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [bug-bash] Pass custom variables to ConditionContext for variable conditions

Custom variable conditions were always evaluating to false because
the customVariables dictionary was empty. Components now get the
customPaywallVariables from the SwiftUI environment and pass them
to their ViewModel's styles() method, which forwards them to
ConditionContext for proper condition evaluation.

Updated components: Stack, Image, Icon, Video, Timeline, Carousel.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* [bug-bash] Make number() and bool() public for CustomVariableValue

Developers need to be able to create numeric and boolean custom
variable values, not just strings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix tabs override condition conversion to preserve extended conditions (#6361)

* Add missing condition evaluation unit tests for PresentedPartials

Closes test coverage gap identified from Android PR #3156. Adds 15 new
test cases covering intro/promo offer negative cases, type safety,
override precedence, and cross-offer independence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add multiple_intro_offers compatibility guardrail tests for iOS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* add bool and number support in paywalls tester (#6394)

* Split intro/promo offer condition JSON keys for backward compatibility with older SDKs (#6397)

Splits legacy boolean conditions (introOffer/promoOffer) from operator-based ones
(introOfferCondition/promoOfferCondition) and updates JSON keys so old SDKs safely
ignore new condition types. Also renames variable → variable_condition and
selected_package → selected_package_condition.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Review fixes: remove multipleIntroOffers from public API, restore private storage, epsilon double comparison

- Remove `multipleIntroOffers` from public `Condition` enum to avoid source-breaking
  change on @Frozen enum. It remains in `ExtendedCondition` and maps to `.unsupported`.
- Restore `Storage` and `storage` to `private` on `CustomVariableValue` — condition
  evaluation uses the existing `isString`/`isNumber`/`isBool` helpers instead.
- Replace exact `==` double comparison with epsilon-based `doublesMatch` to handle
  floating point representation differences from JSON round-trips.
- Add tests for epsilon comparison edge cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove unused legacy buildPartial and shouldApply overloads

All callers use the new buildPartial with conditionContext parameter.
Remove the legacy overload (without conditionContext) and its shouldApply
wrapper that had an unnecessary #available gate returning false on pre-iOS 15.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix condition evaluation not using dashboard default custom variables

ConditionContext was only receiving developer-provided custom variables
from the SwiftUI environment, but not the dashboard-configured defaults.
This caused variable-based conditions (e.g. "something == false") to
always fail when the developer didn't explicitly provide the variable,
even if a default was set in the dashboard.

The fix merges defaultCustomVariables into ConditionContext at init time
(developer values take priority), and passes them from all 8 view model
sites that create ConditionContext.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Wire up conditional configurability for TabsComponent

TabsComponentViewModel had presentedOverrides stored but never evaluated.
Added a styles() method that creates a ConditionContext, calls buildPartial,
and returns a TabsComponentStyle with overrides applied. The view now
evaluates conditions and checks visibility before rendering.

Also updated TabsComponentStyle.init to accept Background? instead of
ColorScheme? to match the actual data model, and added a clarifying
comment to CountdownComponentViewModel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add tests for intro/promo offer conditions with wrong value types

Verify that conditions with non-boolean values (e.g., string instead of
bool) gracefully fall back to .unsupported, triggering the fallback paywall.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Disable autocapitalization on custom variables value TextField

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add bug bash unit tests for conditional configurability (#6398)

Add unit tests derived from the bug bash test plan to cover:
- Override precedence with visibility (two/three overrides, last-matching wins)
- Same condition evaluated independently on multiple components
- Condition + selected state interaction
- Variable match/mismatch for text replacement scenarios
- Intro offer with different eligibility states
- Different condition types on sibling components
- containsUnsupportedConditions for carousel, tabs, button, package, deep nesting

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Add Emerge snapshot previews for conditional configurability (#6400)

* Add Emerge snapshot previews for conditional configurability

Add SwiftUI previews that test basic show/hide behavior using
variable conditions on Text and Stack components. These will be
automatically picked up by Emerge's SnapshotPreviews for visual
regression testing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Improve snapshot preview names for easier debugging

Make display names include the condition, operator, value, and expected
outcome so broken snapshots can be diagnosed at a glance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add ConditionalConfigurabilityPreview.swift to xcodeproj

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix notEquals preview: use matching variable value so condition triggers

The preview set tier="free" with a notEquals "free" condition, which
evaluates to false — the override never applied. Changed to tier="premium"
so the condition matches and the text is correctly hidden.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Show default paywall instead of fallback for unsupported conditions (#6406)

* Show default paywall instead of fallback when unsupported conditions found

Per the spec, when the SDK encounters condition types it doesn't
recognize, it should render the same V2 paywall with only legacy
overrides applied — not fall back to a completely different V1 paywall.

When any unsupported condition is found, all rule-based overrides
(variable, selected_package, intro_offer_condition,
promo_offer_condition, and unsupported) are discarded. Only legacy
overrides (compact, medium, expanded, selected, introOffer,
promoOffer, multipleIntroOffers) are kept. This aligns with Android
PR #3175.

Changes:
- Add `isRule` property to ExtendedCondition to distinguish
  conditional configurability rules from legacy base conditions
- Update toPresentedOverrides to filter out all rule-based overrides
  when any unsupported condition is present
- Remove throw from PaywallsV2View (keep warning log)
- Remove PaywallError.unsupportedCondition (no longer thrown)
- Update log message to explain overrides will be ignored

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Propagate discardRules globally when any component has unsupported conditions

When any component in the paywall tree contains unsupported conditions,
all rule-based overrides are now discarded globally across every component,
not just per-component. This matches the spec requirement for rendering the
"default paywall" with only legacy overrides applied.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Classify .unsupported as non-rule since it pre-dates conditional configurability

Only the extended conditions introduced by conditional configurability
(variable, selectedPackage, introOfferCondition, promoOfferCondition) are
classified as rules. .unsupported existed before coco as a fallback for
unrecognized condition types and always evaluates to false at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix button sheet detection, add cross-subtree tests, align log wording

- Fix containsUnsupportedConditions() to check button sheet destination
  stacks, not just the button's own stack
- Add cross-subtree integration tests: unsupported in button sheet and
  nested tabs triggers global discard on sibling components
- Update warning log to match Android: "Unsupported paywall rule
  encountered. Rendering paywall without conditional configurability rules."

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove redundant local hasUnsupportedCondition check from toPresentedOverrides

The global discardRules flag already walks the entire component tree,
so the per-component hasUnsupportedCondition() fallback in
toPresentedOverrides was redundant. Simplify to only check discardRules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Recurse into timeline item sub-components for unsupported condition detection

TimelineComponent.containsUnsupportedConditions() was only checking
the timeline's own overrides and each item's direct overrides, but not
recursing into item.title, item.description, or item.icon. This meant
unsupported conditions in those sub-components wouldn't set the global
discardRules flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Address review feedback: drop unsupported overrides, deduplicate tree walk, add @_spi

- Filter also drops .unsupported overrides when discardRules is true
- Move warning log after factory call, read factory.discardRules
  instead of traversing the component tree twice
- Mark isRule as @_spi(Internal)
- Add tests: discardRules drops .unsupported and mixed legacy+rule overrides

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Add malformed condition logging and fix missing test file in Xcode project

Log a warning when a known condition type fails to decode instead of
silently falling back to .unsupported. Also add ToPresentedOverridesTests.swift
to the Xcode project to fix the Danger bot missing-file warning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix selected_package condition evaluating against wrong package inside package components (#6412)

PackageComponentView overrides PackageContext for its children (for variable
processing), which caused selected_package conditions to always evaluate against
the package component's own ID instead of the globally selected package.

Fix: introduce a separate @Environment(\.selectedPackageId) key set at the root
that is NOT overridden by PackageComponentView. All component views now read
selectedPackageId from this environment key for condition evaluation.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Rename condOp to conditionOperator in PresentedPartials

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add SelectedPackageId.swift to RevenueCat.xcodeproj

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add .number() and .bool() to CustomVariableValue API tester (#6415)

These were promoted from internal to public in #6285.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Cesar de la Vega <664544+vegaro@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants