Skip to content

[Due for payment 2026-09-15] [$250] [Exploratory] E-card - Clicking replacement card hyperlink leads to Not Here page #95364

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.4.27-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/63205875/folder/13176890/41237386/1539812119?sort=-status_id
Email or phone of affected tester (no customers): applausetester+bm890446@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Web, android
App Component: Other

Action Performed:

Preconditions:
Issue a virtual card for yourself.

  1. Go to staging.new.expensify.com
  2. Navigate to Account > Wallet > Virtual card > Report virtual card fraud.
  3. Go to the workspace chat and locate the replacement card hyperlink.(Click on it a few times.)

Expected Result:

App should not lead to Not Here page.

Actual Result:

Not Here page appears.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7198985_1783116139726.bandicam_2026-07-04_00-58-36-580.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7198985

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. applause-bot commented on Jul 6, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/dee5a55a9eeb1d728f891138ab70dcd88a9a696aaec725d2ceec40481361bddd

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 17, 2026
  3. MelvinBot commented on Jul 17, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The "replacement card" link in the replaced their virtual Expensify Card! system message and the page it opens use two different card lookups, and they can disagree — when they do, the link is clickable but the destination 404s to the Not Here page.

    • The link is only rendered as a clickable <a> when the card resolves as active via useGetExpensifyCardFromReportAction, which (for a non-admin card holder) reads the full card list useCardList() → cardList[cardID].
    • The link points to settings/card/:cardID, which renders ExpensifyCardPage. That page looks the card up in the filtered useNonPersonalCardList() (personal cards removed) and, once the app has finished loading, renders NotFoundPage whenever no card in that list matches the route's cardID.

    So the link renders based on one card list but resolves against a narrower one. If the cardID embedded in the action (originalMessage.cardID of CARD_REPLACED_VIRTUAL, used at ReportActionsUtils.ts:4539-4544) isn't present in the page's filtered list at click time, you get Not Here. The "click it a few times" symptom points at a hydration/timing element right after the replacement card is issued.

    What changes do you think we should make in order to solve the problem?

    Make the link and the destination agree on a single source of truth for the card:

    1. Gate the link on the same lookup the page uses (or vice-versa) so a link is never rendered for a cardID the page can't resolve, and/or
    2. In ExpensifyCardPage, fall back to the full CARD_LIST (by cardID) before deciding to show NotFoundPage, so a valid replacement card that isn't in the filtered/domain list still resolves.
    Verification needed / alternatives considered
    • Confidence: Medium. The NotFoundPage trigger and the two-lookup inconsistency are confirmed in code. What still needs runtime/data confirmation is why the cardID isn't found: (a) the action stores the old/deactivated card's cardID rather than the new one, or (b) the new virtual card isn't yet hydrated into the list ExpensifyCardPage searches when the message renders.
    • To confirm, inspect a real CARD_REPLACED_VIRTUAL report action and check whether originalMessage.cardID is the new replacement card, and whether that cardID exists in CARD_LIST (and survives filterOutPersonalCards) at click time.
    • If it turns out the backend populates originalMessage.cardID with the old/deactivated card, the fix is outside this repo (Auth/Web-Expensify) and should be escalated to an internal engineer — App can only add a defensive guard.
    • Possibly related: Expensify Card - Error shown and card replacement message missing on deactivation #81746 (card replacement message issues on deactivation).

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/95364) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 17, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 17, 2026
  6. melvin-bot commented on Jul 17, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @dmkt9 (External)

  7. wildan-m commented on Jul 17, 2026

    @wildan-m
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-07-17 19:18:05 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After reporting virtual card fraud, the workspace chat shows a "replacement card" system message with a hyperlink to the new card. Clicking that hyperlink leads to the "Not Here" page instead of opening the card details.

    What is the root cause of that problem?

    For an admin, the "replacement card" hyperlink in the card-issued/replaced system message is built in getCardIssuedMessage using createDynamicRoute with no explicit base path:

    const navigateRoute = shouldNavigateToCardDetails
    ? createDynamicRoute(DYNAMIC_ROUTES.EXPENSIFY_CARD_DETAILS.getRoute(String(cardID), policyID))
    : ROUTES.SETTINGS_DOMAIN_CARD_DETAIL.getRoute(String(cardID));

    When no base path is passed, createDynamicRoute prepends Navigation.getActiveRoute() — the screen the user happens to be on when the message HTML is built:

    const createDynamicRoute = (dynamicRouteSuffixWithParams: string, basePath?: string): Route => {
    const [suffixPath] = splitPathAndQuery(dynamicRouteSuffixWithParams);
    if (!suffixPath || !isDynamicRouteSuffix(suffixPath)) {
    throw new Error(`The route name ${suffixPath} is not supported in createDynamicRoute`);
    }
    const routePath = basePath ?? Navigation.getActiveRoute();
    return combinePathAndSuffix(routePath, dynamicRouteSuffixWithParams);

    That result is then baked into a static, persisted <a href> deep link inside the chat HTML:

    const expensifyCardLink = (expensifyCardLinkText: string) =>
    shouldRenderHTML && isExpensifyCardActive ? `<a href='${environmentURL}/${navigateRoute}'>${expensifyCardLinkText}</a>` : expensifyCardLinkText;

    expensify-card-details/:cardID/:policyID is a dynamic (relative) route. getStateFromPath resolves it only when the path segment in front of the suffix corresponds to one of the route's registered entryScreens:

    App/src/ROUTES.ts

    Lines 763 to 767 in 5ed347b

    EXPENSIFY_CARD_DETAILS: {
    path: 'expensify-card-details/:cardID/:policyID',
    entryScreens: [SCREENS.WORKSPACE.EXPENSIFY_CARD, SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.DYNAMIC_PROFILE],
    getRoute: (cardID: string, policyID: string) => `expensify-card-details/${cardID}/${policyID}` as const,
    },

    const entryScreens: ReadonlyArray<Screen | '*'> = DYNAMIC_ROUTES[dynamicRoute as DynamicRouteKey]?.entryScreens ?? [];
    if (focusedRoute?.name && entryScreens.some((s) => s === '*' || s === focusedRoute.name)) {

    Because the base path comes from whatever screen was active when the link was generated, the link only resolves from screens registered in that route's entryScreens. The Search ("Spend") page is not registered, so a link generated on Spend > Chat becomes search/expensify-card-details/<cardID>/<policyID>?q=…, which fails entryScreens validation and the app renders the "Not Here" (NotFoundPage) screen. A link generated from an open report (r/<reportID>) resolves, because that screen is registered — which is why the failure depends on where the message is viewed from.

    What changes do you think we should make in order to solve the problem?

    Keep building the link with createDynamicRoute off the current screen, so the card details still open on top of where the user already is, and instead register the screen that is missing from the route's entryScreens:

    App/src/ROUTES.ts

    Lines 763 to 767 in 5ed347b

    EXPENSIFY_CARD_DETAILS: {
    path: 'expensify-card-details/:cardID/:policyID',
    entryScreens: [SCREENS.WORKSPACE.EXPENSIFY_CARD, SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.DYNAMIC_PROFILE],
    getRoute: (cardID: string, policyID: string) => `expensify-card-details/${cardID}/${policyID}` as const,
    },

    Add SCREENS.SEARCH.ROOT to EXPENSIFY_CARD_DETAILS.entryScreens. That is the screen behind Spend > Chat, so the generated link search/expensify-card-details/<cardID>/<policyID>?q=… then passes entryScreens validation and opens the card details without moving the user off the Spend page.

    Screens that already resolve — an open report (r/<reportID>) and a chat opened from Search (search/view/<reportID>) — are unchanged, and the non-admin branch (ROUTES.SETTINGS_DOMAIN_CARD_DETAIL) is unaffected.

    Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/95364-card-details-deeplink-base-path?expand=1

    What alternative solutions did you explore? (Optional)

    Passing a fixed base path (the workspace Expensify Card route) to createDynamicRoute also makes the link resolve, but it always sends the user into the workspace screen instead of opening the card details over their current screen, so it loses the context createDynamicRoute exists to preserve.

  8. 91 remaining items

  9. melvin-bot commented on Sep 14, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    Upwork Job

    • Reviewer: @mukhrr owed $250 via NewDot
    • Assignee: @dmkt9 requires payment (Needs manual offer from BZ)

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  10. mallenexpensify commented on Sep 16, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @mukhrr due $500 via Upwork
    Contributor+: @dmkt9 due $500 via NewDot

    @dmkt9 paid, summary updated above. Thx.
    https://www.upwork.com/jobs/~022100356424462860055

  11. mallenexpensify commented on Sep 16, 2026

    @mallenexpensify
    Contributor

    @roryabraham 👀 above on the price increase request. Thx

  12. mallenexpensify commented on Sep 16, 2026

    @mallenexpensify
    Contributor

    Claude posting on behalf of Matt:

    $500 each, ie. 200% of the $250 job price. That is a further $250 each on top of the $250 each already paid. @dmkt9 wrote "$500" without saying per payee or for both. If he meant $500 each, the rules agree exactly. If he meant $500 split between the two, the rules give more than he asked.

    PR #98406 by @mukhrr, merged 2026-09-04. 24 files, +322 / -60. 5 test files carry +207 of that
    Contributor @mukhrr, $500 via Upwork. $250 paid 2026-09-16, $250 outstanding
    Contributor+ @dmkt9, $500 via NewDot. $250 paid 2026-09-16, $250 outstanding
    Job price $250, from the title
    Reduction None
    Increase 200%. Scope expansion, which counts as two factors on its own, plus two supporting factors
    Blockers None. Deployed in 9.4.73-3 on 2026-09-08. The 7-day window closed 2026-09-15 with nothing raised
    Regression bar Does not apply. Neither payee is on the offending PR. See below
    Precedent Scope expansion alone paid 200% in five cases and 150% in two, #90067 and #90507. #83207 is the caution: the payee asked 200% and @chuckdries paid 150%
    Needs a ruling No. @dmkt9 must confirm whether "$500" was per payee or for both
    The regression bar, which is the check that would kill this request

    Work to fix a regression from the payee's own PR sits inside the job price and cannot support an increase. Source: @chuckdries on 83207, "I want to make it very clear that we are not bumping it for handling the regression."

    That bar does not apply here. The offending PR is #91161, named in @dmkt9's C+ checklist. @huult wrote it. @mananjadhav and @mjasikowski reviewed and approved it. @mjasikowski merged it. Neither @mukhrr nor @dmkt9 appears in either role.

    @dmkt9 does have one entry on 91161, dated 2026-09-09. That is him completing the C+ checklist step that requires a comment on the offending PR, four months after the merge. It is not a review of that PR and it does not put him on it.

    91161 merged 2026-05-21. This issue was reported 2026-07-06, about seven weeks later, so it also sits well outside the 7-day regression window.

    Three factors present, and one that misses by a single file

    Scope expansion. Present, and it counts as two factors on its own, which alone proposes 200%.

    The issue describes one broken link: the replacement card hyperlink in the workspace chat leads to a Not Here page. One file in the merged PR is that message, src/components/ReportActionItem/IssueCardMessage.tsx, at +3 / -1.

    The other 18 product files are different call sites with the same latent fault, and none of them appears in the issue:

    • src/components/BookTravelButton.tsx
    • src/components/ReceiptAlternativeMethods.tsx
    • src/components/ReportWelcomeText.tsx
    • src/hooks/usePayAndDowngrade.ts
    • src/pages/settings/Security/MergeAccounts/MergeResultPage.tsx
    • src/pages/workspace/accounting/reconciliation/DynamicReconciliationAccountSettingsPage.tsx
    • src/pages/workspace/companyCards/utils.tsx
    • src/pages/workspace/deleteWorkspace/DeleteWorkspaceFlow.tsx
    • src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx
    • src/pages/workspace/members/DynamicWorkspaceOwnerChangeWrapperPage.tsx
    • src/pages/workspace/receiptPartners/WorkspaceReceiptPartnersPage.tsx
    • plus ROUTES.ts, createDynamicRoute.ts, ReportActionsUtils.ts, ReportAlternateTextUtils.ts, ReportNameUtils.ts, ContextMenuActions.tsx, and a new hook, src/hooks/useScreenBoundDynamicRoute.ts at +36

    Travel booking, receipt partners, workspace deletion and account merge are not in the issue text. The test is "the merged work delivered something the issue did not describe", and this meets it from the file list, not from an adjective.

    Core-flow or high-risk change. Present. The fix changes createDynamicRoute and ROUTES.ts and adds a hook that route generation depends on. @dmkt9 counted 477 usages of createDynamicRoute across the codebase. That is shared navigation infrastructure, not one screen.

    The C+ proposal was used. Present. @dmkt9 proposed useRoutePath() and then pointed at the React Navigation hook specifically rather than a custom one. @roryabraham approved on that basis: "using useRoutePath to get the correct base path". The merged hook is built on it.

    Size of the change. Absent, by one file. The threshold is 25 or more files changed, or 1000 or more added lines. The PR changed 24 files and added 322 lines. It misses the file test by one and the line test by a wide margin. Recorded here because a reader who sees 24 files will assume this factor fired. It did not, and the proposal does not rest on it.

    Long review cycle. Not counted. The PR ran 2026-08-12 to 2026-09-04 across 25 commits and 43 comments, and the issue ran from 2026-07-06. The rubric sets no threshold for this factor and one case supports it, so a review that leans on it has to escalate. This one does not need it.

    More than one PR, test breadth, more than one repository. All absent. One PR, five standard platforms, one repo.

    The step. Three factors present, and scope expansion counts as two. Two or more factors propose 200%. No single factor exceeds double its threshold, ie. 50 files, so there is no extra step. 200% of $250 is $500 each.

    The strongest argument against, and why 200% survives it

    The counterargument. @roryabraham rejected the narrow fix and directed the generic approach: "avoid recomputing dynamic routes in components that are not children of the active route." Read that way, the 18 extra files are not extra scope. They are the correct fix for the bug the issue described, and a narrow fix was refused. Under that reading the scope expansion factor falls away.

    200% survives it. Drop scope expansion and two factors remain, core-flow and the C+ proposal. Two factors propose 200%. The amount only moves if a reader rejects the core-flow factor as well, which leaves one factor and 150%, ie. $375 each.

    So the range a reasonable reader can reach is $375 to $500 each, and both the rules and @dmkt9's own request land at $500 each.

    One thing this review did not verify. @dmkt9 says he and @mukhrr reviewed more than 250 files to find the 11 that needed changes. Review effort of that kind leaves no trace this review can check, and no factor in the rubric prices it. The proposal rests on the merged diff, which is checkable.

    @roryabraham for the approval. @dmkt9 please confirm whether "$500" is per payee or for both. @mukhrr the second payment is yours too.


    Claude posting on behalf of Matt. PAYRUBRICTEST v2

  13. roryabraham commented on Sep 17, 2026

    @roryabraham
    Contributor

    $500 sounds fair 👍🏼

    Claude uses language which is very hard to follow in his post, but @dmkt9's increase request was clear enough imo, and having reviewed the code I agree.

  14. dmkt9 commented on Sep 17, 2026

    @dmkt9
    Contributor

    @dmkt9 paid, summary updated above. Thx.
    upwork.com/jobs/~022100356424462860055

    @mallenexpensify Thanks. I've accepted the offer

  15. mukhrr commented on Sep 18, 2026

    @mukhrr
    Contributor

    $500 sounds fair 👍🏼

    @mallenexpensify mind updating summary above pls? thanks

  16. mallenexpensify commented on Sep 18, 2026

    @mallenexpensify
    Contributor

    @dmkt9 paid, summary updated above. Thx.
    Price updated to $500 for @mukhrr and @dmkt9

    Thx

  17. flaviadefaria commented on Sep 22, 2026

    @flaviadefaria
    Contributor

    Approved: @mukhrr due $500 via NewDot

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions