Skip to content

Hide Patron upgrade for subscriptions managed on iOS or Web - #6443

Draft
joashrajin wants to merge 1 commit into
mainfrom
claude/patron-upgrade-duplicate-subs-d44904
Draft

joashrajin wants to merge 1 commit into
mainfrom
claude/patron-upgrade-duplicate-subs-d44904

Conversation

@joashrajin

Copy link
Copy Markdown
Contributor

Description

Plus subscribers who pay through iOS or the web no longer see "Upgrade to Patron" on Android, and the Android purchase flow refuses to start for them.

Previously the row was shown to every Plus subscriber. Tapping it ran a brand-new Google Play Patron purchase. Google Play only knows about its own purchases, so no existing subscription was replaced and the user ended up paying for Plus on the original platform and Patron on Google Play.

  • Subscription.isManagedOnAnotherPlatform (iOS or Web) is now shared in the model module. The TV settings screen used a private copy of the same check.
  • AccountDetailsViewModel hides the "Upgrade to Patron" row when the subscription is managed on another platform.
  • OnboardingUpgradeFeaturesViewModel.purchaseSelectedPlan checks the sign-in state before purchasing and bails out with the existing purchase-failed state, in case another entry point reaches the flow.

Gift and Unknown platforms are intentionally still allowed to upgrade, since they are not billed elsewhere.

Fixes PCDROID-853

Testing Instructions

  1. Sign in to a Plus account whose subscription was bought on the web (Paddle) or iOS.
  2. Open Profile > Account details and verify there is no "Upgrade to Patron" row.
  3. Sign in to a Plus account subscribed through Google Play, open Account details and verify "Upgrade to Patron" is shown and the upgrade still works.
  4. Sign in to a Plus gift account and verify "Upgrade to Patron" is shown.
  5. Run ./gradlew :modules:features:profile:testDebugUnitTest :modules:services:model:testDebugUnitTest :modules:features:account:testDebugUnitTest.

Screenshots or Screencast

Not applicable. The change only hides an existing row.

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the Event Horizon schema to reflect any new or changed analytics.

I have tested any UI changes...

  • with different themes
  • with a landscape orientation
  • with the device set to have a large display and font size
  • for accessibility with TalkBack

Plus subscribers paying through iOS or the web could buy a second Patron
subscription on Google Play. Hide the upgrade row for them and block the
purchase as a second layer of defense.
@joashrajin joashrajin added this to the 8.27 milestone Nov 23, 2026
@joashrajin joashrajin added [Type] Bug Not functioning as intended. [Area] Subscriptions Plus or Patron issue labels Nov 23, 2026
@claude

claude Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @joashrajin's task in 1m 11s —— View job


No blocking issues. The account-details check and the shared isManagedOnAnotherPlatform behave as described, and Gift/Unknown subscribers can still upgrade. One open point: iOS/Web Plus subscribers can still reach the purchase guard from another screen, and when they do it gives them no useful error.

Non-blocking

  • modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/viewmodel/OnboardingUpgradeFeaturesViewModel.kt:152 – Tapping a Patron app icon in Appearance settings takes iOS/Web Plus subscribers through the full paywall to a generic "purchase failed" snackbar. Show a message that their subscription is managed on another platform, and add a test for this branch (the test's mock<UserManager>() has no stub for getSignInState()). Hide Patron upgrade for subscriptions managed on iOS or Web #6443 (comment)

@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

// through Google Play, so buying here would create a duplicate subscription.
val signInState = userManager.getSignInState().asFlow().first()
if ((signInState as? SignInState.SignedIn)?.subscription?.isManagedOnAnotherPlatform == true) {
_state.update { value -> (value as? OnboardingUpgradeFeaturesState.Loaded)?.copy(purchaseFailed = true) ?: value }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(non-blocking) This guard isn't only a fallback. A Plus subscriber billed on iOS or the web can still reach it by tapping a Patron app icon in Appearance settings (AppearanceSettingsFragment.openOnboardingFlow → OnboardingFlow.Upsell). They go through the whole paywall, tap subscribe, and get the generic "purchase failed" snackbar with no explanation and nothing to retry. Consider adding a separate state, or a string such as "Your subscription is managed on iOS/web", so the user knows where to upgrade. It would also help to add a test for this branch. The test currently passes mock<UserManager>() with no stub for getSignInState(), so any future test that calls purchaseSelectedPlan will hit an NPE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Subscriptions Plus or Patron issue [Type] Bug Not functioning as intended.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants