Skip to content

Android: package-selected visibility rules do not hide/show package layers correctly #3329

@powext

Description

@powext

Describe the bug
On Android, package-selection-driven visibility can fail to update correctly inside a paywall package item.

The UX problem is that when a user selects a package, a layer inside that package card that should disappear for the selected state can remain visible. The selection itself changes, but the card does not fully update to reflect the new
visual state, so the paywall looks stale or inconsistent.

iOS (correct behavior):

Android (wrong behavior):

  1. Environment
    1. Platform: Android
    2. SDK version: 9.29.0
    3. OS version: 14
    4. Android Studio version: -
    5. How widespread is the issue. Percentage of devices affected: -
  2. Debug logs (https://docs.revenuecat.com/docs/debugging) that reproduce the issue
  3. Steps to reproduce, with a description of expected vs. actual behavior
    1. Create a paywall with multiple packages.
    2. Add a conditional layer inside a package item that should hide once that package becomes selected.
    3. Open the paywall on Android.
    4. Tap that package.

A possible culprit is the selected-package evaluation in StackComponentState.kt. In particular, override resolution appears to use:

selectedPackageIdentifier = applicablePackage?.identifier

while applicablePackage appears to resolve like this:

style.rcPackage ?: selectedPackageProvider()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions