Skip to content

[Due for payment 2026-07-13] Company card - Clicking on add card in card selector page leads to Not Here page #95359

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?: No
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/63205891/folder/13176706/41236839/1539814294?sort=-status_id
Email or phone of affected tester (no customers): biruknew45+ghghk@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Web, android
App Component: Workspace Settings

Action Performed:

Preconditions:
Create a workspace.
Add one commercial card (e.g., American Express corporate card).

  1. Go to staging.new.expensify.com
  2. Navigate to the company card settings.
  3. Click on the card selector.
  4. Click on Add Card.

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

Bug7198997_1783118900021.bandicam_2026-07-04_01-39-53-181.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @suneox

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/099c55e34818f5e148c712e726e5b2aa56070bbaadb09f5b95502f574a7a169e

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 6, 2026
  3. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    Triggered auto assignment to @cristipaval (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Jul 6, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. MelvinBot commented on Jul 6, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #94280 - "migrate workspace company cards" by @huult (High confidence)
    Related Issues: N/A

    Recommendation: REVERT

    The greedy getMatchingNewRoute redirect rule added by this PR rewrites the "Add Card" dynamic-route path into an invalid company-card-details/... path, which fails entryScreens validation and lands on the Not Found page. A revert cleanly removes the offending rule; if a revert is disruptive, a targeted forward fix is also viable (see Root Cause).

    Assigned: @huult (PR author), @mjasikowski and @suneox (approving reviewers) from highest-confidence causing PR only
    Labels: No changes. Kept DeployBlockerCash — this is a frontend regression from an App PR that blocks the App deploy.

    📋 Detailed Analysis

    Evidence

    • The bug flow is: Company card settings → card selector (feed selector page) → Add Card. On the feed selector page, onAddCardsPress navigates via createDynamicRoute(DYNAMIC_ROUTES.WORKSPACE_COMPANY_CARDS_ADD_NEW.path) (add-card-feed), which appends the suffix to the current active route, producing /workspaces/{policyID}/company-cards/select-feed/add-card-feed.
    • PR migrate workspace company cards #94280 migrated the previously static company-card details route (WORKSPACE_COMPANY_CARD_DETAILS, screen Workspace_CompanyCard_Details, page WorkspaceCompanyCardDetailsPage.tsx) into a dynamic route (DYNAMIC_COMPANY_CARD_DETAILS, path company-card-details/:feed/:cardID). To preserve old deep links, it added greedy backward-compat redirect rules in OldRoutes.ts, including:
      • '/workspaces/*/company-cards/*/*': '/workspaces/$1/company-cards/company-card-details/$2/$3'
    • Reproduces on staging (contains migrate workspace company cards #94280), not production (does not yet contain it) — consistent with the PR being the cause.

    Verification

    • Affected files (all touched by PR migrate workspace company cards #94280):
      • src/libs/Navigation/linkingConfig/OldRoutes.ts:82 — the greedy redirect rule.
      • src/ROUTES.ts:683-691 — WORKSPACE_COMPANY_CARDS_ADD_NEW (add-card-feed, entryScreens [COMPANY_CARDS, COMPANY_CARDS_SELECT_FEED]) and the new dynamic WORKSPACE_COMPANY_CARD_DETAILS (company-card-details/:feed/:cardID).
      • src/SCREENS.ts:701 — new DYNAMIC_COMPANY_CARD_DETAILS screen.
    • Confirmed the "Add Card" navigation path is built in src/pages/workspace/companyCards/WorkspaceCompanyCardFeedSelectorPage.tsx:134.
    • Confirmed the wildcard semantics in src/libs/Navigation/helpers/getMatchingNewRoute.ts:15-30: a non-trailing * matches exactly one segment ([^/]+); the trailing * matches the rest. getMatchingNewRoute also selects the longest matching pattern.
    • Confirmed the entryScreens gate in src/libs/Navigation/helpers/getStateFromPath.ts:25,45-48 runs getMatchingNewRoute on the incoming path before dynamic-suffix resolution, then validates the stripped base path's focused route against entryScreens, falling through to SCREENS.NOT_FOUND otherwise.

    Root Cause

    For the Add Card path /workspaces/{policyID}/company-cards/select-feed/add-card-feed:

    1. getStateFromPath first applies getMatchingNewRoute. The greedy rule '/workspaces/*/company-cards/*/*' matches it ($1=policyID, $2=select-feed, $3=add-card-feed) — no more-specific pattern matches — and rewrites it to /workspaces/{policyID}/company-cards/company-card-details/select-feed/add-card-feed.
    2. The dynamic-suffix resolver strips add-card-feed, leaving base path /workspaces/{policyID}/company-cards/company-card-details/select-feed.
    3. That base path now resolves to the new dynamic DYNAMIC_COMPANY_CARD_DETAILS screen (via company-card-details/:feed/:cardID), so the focused route name is Dynamic_Workspace_CompanyCard_Details.
    4. The add-card-feed route's entryScreens are [COMPANY_CARDS, COMPANY_CARDS_SELECT_FEED], which do not include DYNAMIC_COMPANY_CARD_DETAILS. Validation fails, control falls through, and the state resolves to SCREENS.NOT_FOUND — the "Not Here" page.

    The rule is simply too broad: /workspaces/*/company-cards/*/* was intended to redirect legacy 2-segment feed/cardID details links, but it also swallows the legitimate select-feed/add-card-feed dynamic-route navigation (and would collide with any other 2-segment company-cards path). Preferred forward fix: make the redirect target only genuine legacy details links (e.g. constrain the fallback so it does not match known route segments like select-feed/add-card-feed, or drop this catch-all and rely on the more specific company-card-details/*/* rules already present at OldRoutes.ts:68-72).

  7. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  8. grgia commented on Jul 6, 2026

    @grgia
    Contributor
  9. m-natarajan commented on Jul 6, 2026

    @m-natarajan

    Passed, Chrome and Samsung Galaxy A34/ 16 / v9.4.27-2

    Recording.1029.mp4
    bandicam.2026-07-06.16-48-55-597.1.mp4
  10. changed the title [-]Company card - Clicking on add card in card selector page leads to Not Here page[/-] [+][Due for payment 2026-07-13] Company card - Clicking on add card in card selector page leads to Not Here page[/+] on Jul 6, 2026
  11. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.27-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-07-13. 🎊

    For reference, here are some details about the assignees on this issue:

    • @suneox requires payment through NewDot Manual Requests
    • @huult requires payment through NewDot Manual Requests
  12. melvin-bot commented on Jul 6, 2026

    @melvin-bot

    @suneox / @huult The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  13. melvin-bot commented on Jul 7, 2026

    @melvin-bot

    @suneox / @huult The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions