Repository navigation
[Payment due @QichenZhu] Fix NotFoundPage flash on card details opened via deep link #93910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e4b92a3
fb6f4e1
aa86c87
d24b99f
f58bc39
e83bbce
b5a4d55
126dde1
a43f787
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import type {Route} from '@src/ROUTES'; | ||
|
|
||
| /** | ||
| * Reporting a card lost from a card deep-linked by OldDot (settings/card/:cardID) deletes the original card and lands the | ||
| * user on the replacement card's route. The cardID segment changes, so a plain comparison would no longer match the initial | ||
| * URL. Normalize the cardID segment so the same card-detail screen still counts as a match regardless of which card is shown. | ||
| */ | ||
| function normalizeDomainCardDetailRoute(path: string): string { | ||
| return path.replace(/(^|\/)settings\/card\/[^/?]+/, '$1settings/card/:cardID'); | ||
| } | ||
|
|
||
| /** | ||
| * Whether the initial URL that launched NewDot still matches the currently active route. Used to decide whether the | ||
| * HybridApp single-entry back handoff should fire (i.e. the user is still on the screen OldDot deep-linked into). | ||
| */ | ||
| function doesInitialURLMatchActiveRoute(initialURL: Route | null, activeRouteWithoutParams: string): boolean { | ||
| const initialURLWithoutParams = initialURL?.replaceAll(/\?.*/g, ''); | ||
|
|
||
| if (!initialURLWithoutParams) { | ||
| return false; | ||
| } | ||
|
|
||
| return normalizeDomainCardDetailRoute(initialURLWithoutParams).endsWith(normalizeDomainCardDetailRoute(activeRouteWithoutParams)); | ||
| } | ||
|
|
||
| export default doesInitialURLMatchActiveRoute; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NAB: it might be a separate issue, but the virtual card deactivation flow leads to a not found page. Steps:
Expected result: it lands in the OD Screen_recording_20260623_113830.webm
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed as a pre-existing issue based on my testing with the virtual card flow on v9.4.15-3. Not able to test the physical card flow due to limitations of my account. v9.4.15-3.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: this approach feels a bit ad hoc, but I can't think of a better way.