Conversation
Installed app users were shown "Update the app" pointing at the Play Store instead of the new site, on the strength of a document.referrer check. That check cannot be relied on. The android-app referrer only survives the first navigation of a launch, and this app reloads itself for cache upgrades and after a migration, so from the second boot onward a TWA user is indistinguishable from a browser user and silently falls back to the browser path anyway. The alternatives do not help. display-mode standalone survives reloads but cannot separate a TWA from an installed PWA, and telling a PWA user to update an app they do not have is worse than saying nothing. The user agent carries no marker at all, since a TWA runs on Custom Tabs rather than a WebView. So everyone now gets the same button and a plain navigation. The shipped APK points at web.phcode.dev and lists both origins in its asset statements, so that navigation stays chrome-less for app users. Until that build reaches a device the old one shows a URL bar there, which is cosmetic and self correcting once Play updates the app. Removes the referrer check, the package and store URL constants, the update button and its handler, the twa metrics variant and three strings. The reasoning is left as a comment so the next reader does not reintroduce a check that does not work.
|
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.



Installed app users were shown "Update the app" pointing at the Play Store instead of the new site, on the strength of a document.referrer check. That check cannot be relied on. The android-app referrer only survives the first navigation of a launch, and this app reloads itself for cache upgrades and after a migration, so from the second boot onward a TWA user is indistinguishable from a browser user and silently falls back to the browser path anyway.
The alternatives do not help. display-mode standalone survives reloads but cannot separate a TWA from an installed PWA, and telling a PWA user to update an app they do not have is worse than saying nothing. The user agent carries no marker at all, since a TWA runs on Custom Tabs rather than a WebView.
So everyone now gets the same button and a plain navigation. The shipped APK points at web.phcode.dev and lists both origins in its asset statements, so that navigation stays chrome-less for app users. Until that build reaches a device the old one shows a URL bar there, which is cosmetic and self correcting once Play updates the app.
Removes the referrer check, the package and store URL constants, the update button and its handler, the twa metrics variant and three strings. The reasoning is left as a comment so the next reader does not reintroduce a check that does not work.