You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-08-31] [$250] Expensify Card - Not here page opens when card admin clicks Enable approvals #98490
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.
Go to staging.new.expensify.com
Go to workspace settings > Expensify Card.
Click Issue card.
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.
👋 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:
Identify the pull request that introduced this issue and revert it.
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.
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):
src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx (Issue-new-card flow — the exact repro path)
Access gate confirming the dead-end: WorkspaceWorkflowsPage.tsx:1136 sets shouldShowNotFoundPage={!isGroupPolicy || !canReadWorkflows}, and canReadWorkflows is canMemberRead(policy, currentUserLogin, WORKFLOWS) (line 256). A card admin fails this check, so the page renders Not Found.
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.
@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?
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.
📣 @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:
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.
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.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
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]
Activity
applause-bot commentedon Aug 12, 2026
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
melvin-bot commentedon Aug 12, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #96567
melvin-bot commentedon Aug 12, 2026
@youssef-lr @truph01 you have been assigned to this deploy blocker because you reviewed the offending PR: #96567
melvin-bot commentedon Aug 12, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Aug 12, 2026
👋 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:
MelvinBot commentedon Aug 12, 2026
🔍 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.
DeployBlockerCashis kept (App deploy is blocked, fix is inExpensify/App). NoDeployBlockerlabel is present.📋 Detailed Analysis
Evidence
smartLimitDisabledDescriptionwhose description embeds an inline link:<a href="${workspaceWorkflowsLink}">Enable approvals</a>.${environmentURL}/${ROUTES.WORKSPACE_WORKFLOWS.getRoute(policyID)}and rendered viaRenderHTMLin the limit-type list item.Verification
Affected files (both flows changed by the PR):
src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx(Issue-new-card flow — the exact repro path)LimitTypeStep.tsx:105LimitTypeStep.tsx:114-115src/pages/workspace/expensifyCard/DynamicExpensifyCardLimitTypePage.tsx(edit-existing-card flow — same bug)DynamicExpensifyCardLimitTypePage.tsx:173DynamicExpensifyCardLimitTypePage.tsx:181WorkspaceWorkflowsPage.tsx:1136setsshouldShowNotFoundPage={!isGroupPolicy || !canReadWorkflows}, andcanReadWorkflowsiscanMemberRead(policy, currentUserLogin, WORKFLOWS)(line 256). A card admin fails this check, so the page renders Not Found.git blame/PR file list confirms these exact lines were added by #96567 (the pre-PR code only pushed the Smart Limit option whenareApprovalsConfiguredwas 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+canReadWorkflowsand 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.tsxandDynamicExpensifyCardLimitTypePage.tsx, only render the "Enable approvals" link when the current user can actually access the Workflows page (e.g. gate oncanReadWorkflows/ 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.truph01 commentedon Aug 13, 2026
@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?
MelvinBot commentedon Aug 13, 2026
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_ADMINgranular 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. ItssettlementAccountInfocopy renders a link to the Card reconciliation settings route, which is gatedaccessVariants={[ADMIN, PAID]}(full admin only). Card admin clicks it → Not Found.DynamicWorkspaceSettlementAccountPage.tsx:145(page gate at L156-161)CardReconciliationPage.tsx:1462. 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. ItsintegrationExportTitlecopy links to the accounting export-configuration route (QBO / NetSuite / Sage Intacct / QBD), each gatedaccessVariants={[ADMIN]}only. Card admin clicks it → Not Found.DynamicWorkspaceCompanyCardAccountSelectCardPage.tsx:113(page gate at L99-103)NetSuiteExportConfigurationPage.tsx:219Proposed 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
AccessOrNotFoundWrapperto 404 after navigation. The canonical helper iscanMemberRead(policy, currentUserLogin, CONST.POLICY.POLICY_FEATURE.<FEATURE>), and there's already established precedent for gating links this way inWorkspaceInitialPage.tsx:387(every LHN feature link is conditioned oncanReadPolicyFeature(...)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:
POLICY_FEATURE.WORKFLOWSACCESS_VARIANTS.ADMIN(i.e.isPolicyAdmin)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 byMEMBERSwrite, held only by roles (ADMIN/EDITOR/PEOPLE_ADMIN) that also have Workflows read.isPolicyAdmin.PaymentMethodList"fix connection" → Company Cards link — already gated onisPolicyAdmin.canManage.WorkspaceInitialPage/WorkspaceMoreFeaturesPagefeature links — already per-item gated bycanReadPolicyFeature/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 thisto 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.
24 remaining items
melvin-bot commentedon Aug 30, 2026
Payment Summary
Resolving PRs:
Render role-restricted card links as plain text when viewer lacks access #98612
Reviewer: @truph01 owed $250 via NewDot
BugZero Checklist (@mallenexpensify)
NEXAITECHAU commentedon Aug 30, 2026
/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).melvin-bot commentedon Aug 30, 2026
📣 @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:
Format:
mallenexpensify commentedon Sep 1, 2026
@truph01 from the C+ doc
If it's not due payment, let me know and i can remove [Due for Payment]
truph01 commentedon Sep 2, 2026
@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.
truph01 commentedon Sep 2, 2026
The payment I’d like to suggest for this one is $125.
mallenexpensify commentedon Sep 3, 2026
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
I'm unsure how that comment plays into things, outside of being NAB
melvin-bot commentedon Sep 8, 2026
@mallenexpensify Huh... This is 4 days overdue. Who can take care of this?
garrettmknight commentedon Oct 12, 2026
$125 approved for @truph01