Skip to content

[Due for payment 2026-08-31] [$250] Expensify Card - Not here page opens when card admin clicks Enable approvals #98490

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.53-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #96567
Email or phone of affected tester (no customers): sdsiodjnosdjiodsj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Set up workspace with Expensify Card feature.
  • Disable Approvals in Workflows.
  • Invite User B as card admin.
  • Perform the steps below as card admin.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Expensify Card.
  3. Click Issue card.
  4. Proceed to Choose a limit type.
    5, Click Enable approvals.

Expected Result:

Warning modal should show up saying that card admin cannot access the feature.

Actual Result:

Not here page opens.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7232033_1786563069104.3.mp4

View all open jobs on GitHub

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

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

Activity

  1. applause-bot commented on Aug 12, 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/3e1d36293a7765251f5e8e7de3c36733fc5cdd456a71f2d5fc81560ece22ab25

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

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #96567

  4. melvin-bot commented on Aug 12, 2026

    @melvin-bot

    @youssef-lr @truph01 you have been assigned to this deploy blocker because you reviewed the offending PR: #96567

  5. melvin-bot commented on Aug 12, 2026

    @melvin-bot

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

  6. github-actions commented on Aug 12, 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.
  7. MelvinBot commented on Aug 12, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #96567 - "Show Smart Limit card option disabled when approvals are optional" by @MelvinBot (High confidence)
    Related Issues: #94072 (the issue this PR implemented)

    Recommendation: ROLL FORWARD

    The PR is self-contained and its core feature (showing a disabled Smart Limit option on Optional-approvals workspaces) works correctly for workspace admins; only the new inline "Enable approvals" link dead-ends for card admins who lack Workflows access, so a targeted fix is preferable to reverting a valid feature. A clean revert is a safe fallback if a fix can't land quickly, since the PR has no dependent PRs.

    Assigned: @youssef-lr (PR approver/merger) and @truph01 (approving reviewer) — already auto-assigned to this blocker.
    Labels: No change. DeployBlockerCash is kept (App deploy is blocked, fix is in Expensify/App). No DeployBlocker label is present.

    📋 Detailed Analysis

    Evidence

    • PR Show Smart Limit card option disabled when approvals are optional #96567 (merged 2026-08-12, same day this blocker was filed) reworked the Expensify Card "Choose a limit type" step so the Smart Limit option is always shown, but disabled when the workspace uses Optional approvals.
    • As part of that, it introduced a new copy string smartLimitDisabledDescription whose description embeds an inline link: <a href="${workspaceWorkflowsLink}">Enable approvals</a>.
    • The link target is built as ${environmentURL}/${ROUTES.WORKSPACE_WORKFLOWS.getRoute(policyID)} and rendered via RenderHTML in the limit-type list item.
    • Clicking that "Enable approvals" link navigates to the workspace Workflows page. A card admin (not a Workflows/policy admin) cannot read that page, so it renders the "Not here" (Not Found) page — matching the reported ACTUAL result. The feature is new, so it does not reproduce on production (staging-only), consistent with the report.

    Verification

    Affected files (both flows changed by the PR):

    git blame/PR file list confirms these exact lines were added by #96567 (the pre-PR code only pushed the Smart Limit option when areApprovalsConfigured was true and contained no link).

    Root Cause

    The PR surfaces a disabled Smart Limit row whose description contains an "Enable approvals" hyperlink pointing directly at the Workflows settings route. That route is gated by AccessOrNotFoundWrapper + canReadWorkflows and is not accessible to a card admin who is not a Workflows/policy admin. Because the link navigates unconditionally instead of checking the current user's access (or showing the intended warning modal), card admins are dropped onto the "Not here" page. The expected behavior (a warning modal explaining the card admin cannot access the feature) was never wired up for the no-access case.

    Suggested targeted fix

    In both LimitTypeStep.tsx and DynamicExpensifyCardLimitTypePage.tsx, only render the "Enable approvals" link when the current user can actually access the Workflows page (e.g. gate on canReadWorkflows / policy-admin status). For users without access, either render the description as plain non-linked text or trigger the intended warning modal instead of navigating. This preserves the feature for admins while removing the dead-end for card admins.

  8. truph01 commented on Aug 13, 2026

    @truph01
    Contributor

    @MelvinBot This is a common pattern in our app: we always display hyperlinks regardless of whether the user has permission to access the destination. If the user doesn't have permission, we display the Not Found page, which is expected behavior.

    Could you help me identify other similar places in the app where we always show a hyperlink, but the destination is restricted to specific roles or users, and propose a fix for this issue?

  9. MelvinBot commented on Aug 13, 2026

    @MelvinBot
    Contributor

    Yes — this is a real, repeatable pattern, and I found two more confirmed instances of it, both in the same Expensify Card / Company Cards admin surface where the CARD_ADMIN granular role exists (that role is what makes the mismatch reproducible — it can reach a card page but lacks access to the linked destination).

    Other places with the same anti-pattern

    1. Settlement account → Card reconciliation link
    The Expensify Card settlement account page is gated on EXPENSIFY_CARD (WRITE), so a card admin can open it. Its settlementAccountInfo copy renders a link to the Card reconciliation settings route, which is gated accessVariants={[ADMIN, PAID]} (full admin only). Card admin clicks it → Not Found.

    2. Company card export → accounting export-config link
    The company-card "select account" page is gated on EXPENSIFY_CARD / COMPANY_CARDS (WRITE), reachable by a card admin. Its integrationExportTitle copy links to the accounting export-configuration route (QBO / NetSuite / Sage Intacct / QBD), each gated accessVariants={[ADMIN]} only. Card admin clicks it → Not Found.

    Proposed fix (same for all three, including this deploy blocker)

    Gate the link on the same access check the destination page uses, instead of rendering it unconditionally and relying on AccessOrNotFoundWrapper to 404 after navigation. The canonical helper is canMemberRead(policy, currentUserLogin, CONST.POLICY.POLICY_FEATURE.<FEATURE>), and there's already established precedent for gating links this way in WorkspaceInitialPage.tsx:387 (every LHN feature link is conditioned on canReadPolicyFeature(...) before it's built).

    When the viewer lacks access, either render the description as plain (non-linked) text, or wire the intended warning modal. Feature → check mapping for the three sites:

    • Enable approvals link (this issue) → POLICY_FEATURE.WORKFLOWS
    • Card reconciliation link → ACCESS_VARIANTS.ADMIN (i.e. isPolicyAdmin)
    • Accounting export-config link → ACCESS_VARIANTS.ADMIN (i.e. isPolicyAdmin)
    Candidates I checked and ruled out (already safe)

    These render inline route links but are not affected, because everyone who can see the link already has read access to the destination:

    • roleCannotBeChanged (Workflows "payer" link on member details) — gated by MEMBERS write, held only by roles (ADMIN/EDITOR/PEOPLE_ADMIN) that also have Workflows read.
    • Change-approver Workflows links — the change-approver action itself requires isPolicyAdmin.
    • PaymentMethodList "fix connection" → Company Cards link — already gated on isPolicyAdmin.
    • Categories/Tags "accounting" links — already conditioned on canManage.
    • All WorkspaceInitialPage / WorkspaceMoreFeaturesPage feature links — already per-item gated by canReadPolicyFeature / isPolicyAdmin.

    The common thread in the broken cases: the source page is gated on a granular card role (EXPENSIFY_CARD / COMPANY_CARDS) while the linked destination is gated on full admin (ADMIN) or a different feature (WORKFLOWS / ACCOUNTING). Any link that crosses that granular-role → full-admin boundary is a candidate.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement this to create a draft PR fixing all three sites (this issue + the two above).
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  10. 24 remaining items

  11. melvin-bot commented on Aug 30, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    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
  12. NEXAITECHAU commented on Aug 30, 2026

    @NEXAITECHAU

    /bounty claim

    Claiming. NEX Agent Co. working on this — drafting a PR now.

    This is an automated claim by an AI agent (NEX Agent Co.). Wallet: 0xf47bdf9add81ff2130509ec564d3387072ba5726 (Base USDC).

  13. melvin-bot commented on Aug 30, 2026

    @melvin-bot

    📣 @NEXAITECHAU! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  14. mallenexpensify commented on Sep 1, 2026

    @mallenexpensify
    Contributor

    @truph01 from the C+ doc

    If there are posts on the PR or issue that reference a regression or deploy blocker, C+ posts on the issue and confirms regression (which will reduce pay by 50%) or provides reasoning why they shouldn’t be considered. If the C+ doesn’t update the issue, the contributor manager making the payment will assume any mention of a regression or deploy blockers reduces the issue amount.

    If it's not due payment, let me know and i can remove [Due for Payment]

  15. truph01 commented on Sep 2, 2026

    @truph01
    Contributor

    @mallenexpensify This issue is an improvement that was identified during QA testing of the original PR.

    Based on this comment, I believe this issue should be treated as an improvement to the original PR.

  16. truph01 commented on Sep 2, 2026

    @truph01
    Contributor

    The payment I’d like to suggest for this one is $125.

  17. mallenexpensify commented on Sep 3, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @truph01 due $125 via NewDot

    @youssef-lr , comment if you disagree. I'm thinking $125 vs $0 (cuz it's a regression) based on this above

    Image

    Based on #98490 (comment), I believe this issue should be treated as an improvement to the original PR.

    I'm unsure how that comment plays into things, outside of being NAB

  18. melvin-bot commented on Sep 8, 2026

    @melvin-bot

    @mallenexpensify Huh... This is 4 days overdue. Who can take care of this?

  19. garrettmknight commented on Oct 12, 2026

    @garrettmknight
    Contributor

    $125 approved for @truph01

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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions