Skip to content

Recognize the performance-optimized paywall paths as subscription URLs - #9778

Open
Kyriakos-Georgiopoulos wants to merge 2 commits into
feature/kyriakos/performance-optimized-paywalls/url-resolverfrom
feature/kyriakos/performance-optimized-paywalls/url-interception
Open

Kyriakos-Georgiopoulos wants to merge 2 commits into
feature/kyriakos/performance-optimized-paywalls/url-resolverfrom
feature/kyriakos/performance-optimized-paywalls/url-interception

Conversation

@Kyriakos-Georgiopoulos

@Kyriakos-Georgiopoulos Kyriakos-Georgiopoulos commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/task/1218361229739464
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable): None

Description

Makes the app recognize the performance-optimized paywall paths as subscription URLs, so a link straight to one of them opens the purchase screen instead of a plain tab the user cannot buy from.

  • The matcher accepted /pro and /subscriptions with nothing after them, so the new paths fell through. It now also accepts the paths from the flag settings, which keeps them remote-configurable Add performanceOptimizedPaywalls feature flag (off by default) privacy-configuration#5809
  • Params the app does not own, such as origin, and any query the buy URL itself carries are both preserved.
  • With the flag off, nothing is matched and behavior is unchanged.

Steps to test this PR

  • Apply the pinned staging patch from https://app.asana.com/1/137249556945/project/1209991789468715/task/1210448620621729?focus=true and install the internal debug build on a device with Google Play. Without offers from Play the paywall URL is never rewritten, so every check below would fail.
  • Settings > Internal Features > Feature Flag Inventory, search performanceOptimizedPaywalls, turn it on.
  • Filter logcat on SubscriptionsWebViewActivity. It logs the URL every time the paywall opens, and every check below just reads that line.
  • Optional, to see the page render: take the current front end tunnel URL from https://app.asana.com/1/137249556945/task/1216295712277568, put it in Settings > Internal Features > Subscriptions Dev Settings > "Enter the base URL for subscriptions", and Save. The tunnel is temporary.

A link to a new path opens the purchase screen

  • Open https://duckduckgo.com/subscriptions/new/mobile/duckai from the address bar. The purchase screen opens, not a web page in the tab, and the URL is /subscriptions/new/mobile/duckai with trial and pir.
  • Repeat with /subscriptions/new/mobile/vpn. URL should be /subscriptions/new/mobile/vpn.

Only configured paths

  • Open https://duckduckgo.com/subscriptions/new/mobile/itr, which is not in the config. It stays a web page in the tab.

Params

  • Open https://duckduckgo.com/subscriptions/new/mobile/duckai?origin=test. origin=test survives onto the loaded URL alongside trial and pir.

Old entry points

Flag off

  • Turn performanceOptimizedPaywalls off, open /subscriptions/new/mobile/duckai again. It stays a web page in the tab, which is the behaviour on develop.
  • Open https://duckduckgo.com/pro. Purchase screen opens on /subscriptions, with no trial or pir.

Note

Medium Risk
Changes subscription deep-link routing and paywall URL rewriting behind a feature flag; incorrect matching or query merging could send users to the wrong paywall or break attribution params.

Overview
When performanceOptimizedPaywalls is on, deep links to remotely configured paywall paths (e.g. /subscriptions/new/mobile/vpn) are treated like /pro and /subscriptions, so they open the native purchase WebView instead of a normal tab.

isSubscriptionUrl and shouldLaunchSubscriptionForUrl use PaywallPathProvider.getFeaturePage for those paths; with the flag off, matching stays limited to the legacy single-segment URLs.

buildSubscriptionUrl now merges the buy URL’s existing query with the incoming link, maps a configured path to a featurePage query param (without duplicating an explicit non-blank featurePage), and preserves params like origin. PaywallPathProvider adds reverse path lookup, trailing-slash normalization, and in-memory caching of parsed flag settings.

Reviewed by Cursor Bugbot for commit 1e7ddc0. Bugbot is set up for automated code reviews on this repo. Configure here.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 16be7dc. Configure here.

@nalcalag nalcalag self-assigned this Sep 11, 2026
@Kyriakos-Georgiopoulos
Kyriakos-Georgiopoulos force-pushed the feature/kyriakos/performance-optimized-paywalls/url-interception branch from 16be7dc to 053007c Compare September 11, 2026 08:27
@Kyriakos-Georgiopoulos
Kyriakos-Georgiopoulos force-pushed the feature/kyriakos/performance-optimized-paywalls/url-resolver branch from 646e4bc to 9aac626 Compare September 11, 2026 08:27
@Kyriakos-Georgiopoulos
Kyriakos-Georgiopoulos force-pushed the feature/kyriakos/performance-optimized-paywalls/url-interception branch from 053007c to 7e33986 Compare September 11, 2026 08:56
@Kyriakos-Georgiopoulos
Kyriakos-Georgiopoulos force-pushed the feature/kyriakos/performance-optimized-paywalls/url-resolver branch from c08ad22 to 6efc658 Compare September 11, 2026 09:52
@Kyriakos-Georgiopoulos
Kyriakos-Georgiopoulos force-pushed the feature/kyriakos/performance-optimized-paywalls/url-interception branch from 7e33986 to 6061d74 Compare September 11, 2026 09:53

@nalcalag nalcalag left a comment

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.

LGTM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants