Open the performance-optimized paywall URLs when the flag is on - #9757
Open
Kyriakos-Georgiopoulos wants to merge 3 commits into
Open
Kyriakos-Georgiopoulos wants to merge 3 commits into
Kyriakos-Georgiopoulos wants to merge 3 commits into
Conversation
12 tasks
nalcalag
reviewed
Sep 11, 2026
nalcalag
left a comment
Contributor
There was a problem hiding this comment.
It works as expected. Main thing I'd revisit is how the resolved URL reaches the WebView , now that resolving isn't instant, a fire-and-forget event leaves a window where it can go missing and the user gets an empty screen. Holding it as state the activity can read at any point (a MutableStateFlow rather than a Command) would be safer. Something like:
private val _initialUrl = MutableStateFlow<String?>(null)
val initialUrl = _initialUrl.asStateFlow()
Resolves the paywall URL where the webview loads it, so every entry point is covered. Non-owned params such as origin are carried onto the new path. https://app.asana.com/1/137249556945/task/1217750626830941
Kyriakos-Georgiopoulos
force-pushed
the
feature/kyriakos/performance-optimized-paywalls/url-resolver
branch
from
September 11, 2026 08:27
646e4bc to
9aac626
Compare
Kyriakos-Georgiopoulos
force-pushed
the
feature/kyriakos/performance-optimized-paywalls/url-resolver
branch
from
September 11, 2026 09:52
c08ad22 to
6efc658
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task/Issue URL: https://app.asana.com/1/137249556945/project/1217319487385906/task/1217750626830941?focus=true
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable): None
Description
Opens the performance-optimized paywall page when the
performanceOptimizedPaywallsflag is on, so the front end can test the faster entry points on Android.performanceOptimizedPaywallsfeature flag (off by default) privacy-configuration#5809trial=trueortrial=falsefrom free trial eligibility, andpir=falsewhen PIR is not part of the offer, so the page renders without asking the app what the user is being offered.origin, are carried onto the new path unchanged.Steps to test this PR
performanceOptimizedPaywallsfeature flag (off by default) privacy-configuration#5809.performanceOptimizedPaywalls, turn it on.SubscriptionsWebViewActivity. It logs the URL every time the paywall opens. Every check below just reads that line.VPN paywall
/subscriptions/new/mobile/vpn.Duck.ai paywall
/subscriptions/new/mobile/duckai, with nofeaturePagein the query.Query params
trial=true. Account that already used a trial:trial=false.pir=falsepresent. Region with PIR: nopirparam.origin=funnel_appsettings_androidandenvironment=stagingboth survive onto the new path.Flag off
performanceOptimizedPaywallsoff, open the paywall. URL should be/subscriptionswith notrialorpir, and the old page loads.Fallback
UX changes
existing_paywall.mp4
optimized_paywall.mp4
Note
Medium Risk
Changes which URL loads at paywall open and depends on Play offer/trial state; fallbacks keep the legacy URL, but wrong rewrite could affect purchase funnel and analytics origins.
Overview
When
performanceOptimizedPaywallsis enabled, the subscriptions webview no longer loads the generic buy URL directly. A newPaywallUrlResolverrewrites matching paywall URLs to remote-config entry paths (VPN vs Duck.ai fromfeaturePage), injectstrialfrom free-trial eligibility andpir=falsewhen PIR isn’t on the offer, and preserves other query params likeorigin. If the flag is off, offers aren’t ready, or rewrite fails, the original URL is used unchanged.SubscriptionWebViewViewModelresolves that URL once and exposes it viainitialUrl;SubscriptionsWebViewActivitywaits for the first resolved URL beforeloadUrl. Shared constants for feature pages and query keys replace a local Duck.ai string in JS messaging. Unit tests cover resolver behavior and view-model URL resolution.Reviewed by Cursor Bugbot for commit 6efc658. Bugbot is set up for automated code reviews on this repo. Configure here.