feat(tips): put the tipcard link at the root when there's no handle - #1340
Merged
Conversation
An unclaimed card shared `app.flipcash.com/tip/{uuid}` while a claimed one
shared `flipcash.com/{handle}`, so claiming a handle changed the host and the
path shape of a link its owner may already have printed or posted. Both forms
now sit at the root of the apex host: `flipcash.com/{uuid}` until there's a
handle, `flipcash.com/{handle}` after.
AppRouter's bare-host branch takes either shape. A uuid can't be mistaken for a
handle — dashes aren't in the `[a-z0-9_]{2,15}` charset and 36 characters
overruns it — so the two share the root without ambiguity, and only the handle
form needs the reserved-path list that keeps `/download` and `/privacy` with the
website. The shape test is a regex rather than `UUID.fromString`, which also
accepts `1-1-1-1-1`: an unrecognised path on this host goes back to the browser,
and claiming a looser shape would take taps away from pages the website serves.
The manifest gains a matching uuid `pathAdvancedPattern`. As with the handle
pattern, the platform ignores it below API 31 and the whole host arrives, which
is why `isProfileLink` makes the same distinction in code.
`app.flipcash.com/tip/{uuid}` still routes. Links already shared carry it;
nothing writes it any more.
Matches code-payments/code-ios-app#670, which moves the same link to the root.
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.
An unclaimed card shared
app.flipcash.com/tip/{uuid}while a claimed one sharedflipcash.com/{handle}, so claiming a handle changed both the host and the path shape of a link its owner may already have printed or posted. Both forms now sit at the root of the apex host:flipcash.com/{uuid}until there's a handle,flipcash.com/{handle}after.Linkify.tipcardis the only place either URL is built, so that's a one-line change. The rest is making the link resolve back into the app.Routing
AppRouter's bare-host branch (isVanityProfile, nowisProfileLink) takes either shape. A uuid can't be mistaken for a handle — dashes aren't in the server's[a-z0-9_]{2,15}charset and 36 characters overruns it — so the two share the root without ambiguity, and only the handle form needs the reserved-path list that keeps/downloadand/privacywith the website.The uuid test is a regex rather than
UUID.fromString, which also accepts1-1-1-1-1. An unrecognised path on this host is handed back to the browser, so claiming a looser shape would take taps away from pages the website serves.VANITY_HOSTandreservedVanityPathsare renamed toPROFILE_HOSTandreservedProfilePaths: the host now carries both forms, and only one of them is a vanity link.Manifest
A matching uuid
pathAdvancedPatternforflipcash.comandwww.flipcash.com, withA-Fin the set for the same reason the handle pattern hasA-Z— the matcher is case-sensitive and a link gets typed or auto-capitalised. As with the handle pattern, the platform ignores it below API 31 and the whole host arrives, which is whyisProfileLinkmakes the same distinction in code.Compatibility
app.flipcash.com/tip/{uuid}still routes, and its App Link filter is untouched. Links already shared carry that form; nothing writes it any more.iOS
code-payments/code-ios-app#670 moves the same link to the root. The two agree on the produced shape, on rejecting a partial uuid, and on the abbreviated display (
flipcash.com/b0ced…).One tolerance difference: iOS also parses a root uuid on
app.flipcash.comand under its custom scheme, where Android accepts it on the bare andwwwhosts only. Nothing builds those forms, and Android's manifest doesn't claim them, so widening the router alone wouldn't make such a link arrive. Left as is.Depends on
flipcash.com/{uuid}has to resolve on the website for a tap without the app installed. Verification for the apex already relies onassetlinks.jsonathttps://flipcash.com/.well-known/, which the handle links needed too.