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
[$250] [Due for payment 2026-04-17] LHN - Negative expenses show "Mark as paid" action but "Pay" badge is not visible on LHN. #85187
Version Number: 9.3.37.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:#85025 Email or phone of affected tester (no customers):ibellicotest+2250@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome App Component: Left Hand Navigation (LHN)
Action Performed:
Prerequisite: Account has at least one workspace.
Prerequisite 2: Delayed submissions, approvals and payments enabled.
Open the staging.new.expensify.com website.
Open workspace chat.
Create a manual expense with negative amount.
Submit and approve the expense.
Note that expense preview shows "Mark as paid" action.
Note that no "Pay" action badge is visible on chat preview on LHN.
Expected Result:
"Pay" action badge should be visible on chat preview on LHN for expenses with negative amount, as expense displays the "Mark as paid" action.
Actual Result:
"Pay" action badge is not displayed on chat preview on LHN for expenses with negative amount, despite expense displaying a "Mark as paid" action.
👋 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: #85025 - "feat: Expand GBR/RBR with an action badge" by @aimane-chnaif (High confidence)
Recommendation: REVERT
PR #85025 introduced a new action badge feature for the LHN (Left Hand Navigation) that shows text badges like "Submit", "Approve", and "Pay" instead of colored dots. However, the implementation did not account for negative expenses that show a "Mark as paid" action.
Root Cause: The function getIOUReportActionWithBadge (src/libs/actions/IOU/index.ts:9805) calls canIOUBePaid with onlyShowPayElsewhere=false (default), which returns false for negative amounts. For negative expenses, the "Mark as paid" action is only shown when onlyShowPayElsewhere=true, but the badge logic does not check this condition.
Labels: This is a frontend bug - the issue is caused by App PR #85025 and the fix requires changes to App code. No backend changes needed. Keeping DeployBlockerCash label, removing DeployBlocker label.
The logic for determining the "Pay" action badge in getIOUReportActionWithBadge:
// Line 9805 in src/libs/actions/IOU/index.tsif(canIOUBePaid(iouReport,chatReport,policy,undefined,undefined,undefined,undefined,invoiceReceiverPolicy)){actionBadge=CONST.REPORT.ACTION_BADGE.PAY;returntrue;}
However, canIOUBePaid has special handling for negative amounts that requires onlyShowPayElsewhere=true:
// Lines 9734 and 9744 in canIOUBePaid functionconstcanShowMarkedAsPaidForNegativeAmount=onlyShowPayElsewhere&&reimbursableSpend<0;// ...return(isPayer&&isReportFinished&&!iouSettled&&(reimbursableSpend>0||canShowMarkedAsPaidForNegativeAmount)&&// ... other conditions);
When onlyShowPayElsewhere=false (the default used in the badge logic), the function returns false for negative amounts, so no "Pay" badge is shown even though the expense preview shows "Mark as paid" button.
The expense preview component correctly handles this case:
Please re-state the problem that we are trying to solve in this issue.
When a negative amount expense is created, submitted, and approved, the expense preview correctly shows a "Mark as paid" action, but the LHN (Left Hand Navigation) does not display the corresponding "Pay" action badge. The badge should be visible to match the available action.
What is the root cause of that problem?
The root cause is a parameter asymmetry in how canIOUBePaid is called from the LHN badge path vs. the expense preview.
This guard only activates when onlyShowPayElsewhere is true. For negative expenses, reimbursableSpend is negative (because expense report totals are stored inverted in the DB and then negated back in getMoneyRequestSpendBreakdown at src/libs/ReportUtils.ts:4412), so the standard reimbursableSpend > 0 check fails.
The expense preview (MoneyReportHeader / MoneyRequestReportPreviewContent) works correctly because it calls canIOUBePaidtwice — first with onlyShowPayElsewhere=false, and if that fails, again with onlyShowPayElsewhere=true. The second call enables canShowMarkedAsPaidForNegativeAmount, so "Mark as paid" appears.
The LHN badge path (getIOUReportActionWithBadge at src/libs/actions/IOU/index.ts:9805) calls canIOUBePaidonly once with onlyShowPayElsewhere left as undefined (defaults to false). So for negative amounts, canShowMarkedAsPaidForNegativeAmount is false, the reimbursableSpend > 0 check also fails, and no PAY badge is assigned.
What changes do you think we should make in order to solve the problem?
In getIOUReportActionWithBadge (src/libs/actions/IOU/index.ts:9805), mirror the two-step pattern used by MoneyReportHeader: if canIOUBePaid returns false with default parameters, try again with onlyShowPayElsewhere = true. If the second call succeeds, still assign ACTION_BADGE.PAY.
What alternative solutions did you explore? (Optional)
An alternative would be to modify canIOUBePaid itself to remove the onlyShowPayElsewhere requirement for negative amounts entirely. However, the onlyShowPayElsewhere parameter appears intentional — it distinguishes between showing a full "Pay" button vs. a "Mark as paid" / "Pay elsewhere" button. The two-step pattern in the badge path is more consistent with the existing approach in MoneyReportHeader and MoneyRequestReportPreviewContent.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-][Due for payment 2026-04-17] LHN - Negative expenses show "Mark as paid" action but "Pay" badge is not visible on LHN.[/-][+][$250] [Due for payment 2026-04-17] LHN - Negative expenses show "Mark as paid" action but "Pay" badge is not visible on LHN.[/+]on Apr 18, 2026
📣 @Daddaabdelghafour! 📣
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>
Proposal for Issue #85187 — LHN: Negative expenses show "Mark as paid" action but "Pay" badge is not visible**
Root Cause Analysis
The issue is a conditional rendering mismatch between two separate logic paths:
The "Mark as paid" action is correctly triggered for negative expenses
The "Pay" badge in the LHN has an additional guard condition that likely checks amount > 0 (or similar), which incorrectly excludes negative expense amounts
These two conditions should be in sync — if the action is shown, the badge must be shown too.
Fix Approach
Locate the LHN badge rendering logic — likely in SidebarUtils.ts or the relevant report/transaction selector that determines badge visibility
Find the condition controlling the "Pay" badge display and compare it against the condition showing the "Mark as paid" action
Remove or adjust the amount guard so negative expenses are treated consistently across both the action and the badge
Ensure no regression for positive expense flows — the fix should be scoped to the mismatch only
Testing Plan**
Verify "Pay" badge appears on LHN for negative expenses after fix
Confirm "Mark as paid" action still works correctly
Test on iOS, Android, and web with screenshots before submitting PR
Confirm no regression for standard positive expense flows
Activity
melvin-bot commentedon Mar 13, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #85025
melvin-bot commentedon Mar 13, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 13, 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:
OSBotify commentedon Mar 13, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #85025 - "feat: Expand GBR/RBR with an action badge" by @aimane-chnaif (High confidence)
Recommendation: REVERT
PR #85025 introduced a new action badge feature for the LHN (Left Hand Navigation) that shows text badges like "Submit", "Approve", and "Pay" instead of colored dots. However, the implementation did not account for negative expenses that show a "Mark as paid" action.
Root Cause: The function
getIOUReportActionWithBadge(src/libs/actions/IOU/index.ts:9805) callscanIOUBePaidwithonlyShowPayElsewhere=false(default), which returnsfalsefor negative amounts. For negative expenses, the "Mark as paid" action is only shown whenonlyShowPayElsewhere=true, but the badge logic does not check this condition.Labels: This is a frontend bug - the issue is caused by App PR #85025 and the fix requires changes to App code. No backend changes needed. Keeping
DeployBlockerCashlabel, removingDeployBlockerlabel.📋 Detailed Analysis
Evidence
Verification
Affected files:
src/libs/actions/IOU/index.ts- Contains thegetIOUReportActionWithBadgefunctionsrc/components/LHNOptionsList/OptionRowLHN.tsx- Renders the action badge in LHNPR feat: Expand GBR/RBR with an "action badge" #85025 modifies these files: Confirmed via
gh pr view 85025 --json filesRoot Cause
The logic for determining the "Pay" action badge in
getIOUReportActionWithBadge:However,
canIOUBePaidhas special handling for negative amounts that requiresonlyShowPayElsewhere=true:When
onlyShowPayElsewhere=false(the default used in the badge logic), the function returnsfalsefor negative amounts, so no "Pay" badge is shown even though the expense preview shows "Mark as paid" button.The expense preview component correctly handles this case:
But the LHN badge logic does not check for
onlyShowPayElsewhere.MelvinBot commentedon Mar 13, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a negative amount expense is created, submitted, and approved, the expense preview correctly shows a "Mark as paid" action, but the LHN (Left Hand Navigation) does not display the corresponding "Pay" action badge. The badge should be visible to match the available action.
What is the root cause of that problem?
The root cause is a parameter asymmetry in how
canIOUBePaidis called from the LHN badge path vs. the expense preview.canIOUBePaid(src/libs/actions/IOU/index.ts:9734) has a special guard for negative amounts:This guard only activates when
onlyShowPayElsewhereistrue. For negative expenses,reimbursableSpendis negative (because expense report totals are stored inverted in the DB and then negated back ingetMoneyRequestSpendBreakdownatsrc/libs/ReportUtils.ts:4412), so the standardreimbursableSpend > 0check fails.The expense preview (
MoneyReportHeader/MoneyRequestReportPreviewContent) works correctly because it callscanIOUBePaidtwice — first withonlyShowPayElsewhere=false, and if that fails, again withonlyShowPayElsewhere=true. The second call enablescanShowMarkedAsPaidForNegativeAmount, so "Mark as paid" appears.The LHN badge path (
getIOUReportActionWithBadgeatsrc/libs/actions/IOU/index.ts:9805) callscanIOUBePaidonly once withonlyShowPayElsewhereleft asundefined(defaults tofalse). So for negative amounts,canShowMarkedAsPaidForNegativeAmountisfalse, thereimbursableSpend > 0check also fails, and noPAYbadge is assigned.What changes do you think we should make in order to solve the problem?
In
getIOUReportActionWithBadge(src/libs/actions/IOU/index.ts:9805), mirror the two-step pattern used byMoneyReportHeader: ifcanIOUBePaidreturnsfalsewith default parameters, try again withonlyShowPayElsewhere = true. If the second call succeeds, still assignACTION_BADGE.PAY.What alternative solutions did you explore? (Optional)
An alternative would be to modify
canIOUBePaiditself to remove theonlyShowPayElsewhererequirement for negative amounts entirely. However, theonlyShowPayElsewhereparameter appears intentional — it distinguishes between showing a full "Pay" button vs. a "Mark as paid" / "Pay elsewhere" button. The two-step pattern in the badge path is more consistent with the existing approach inMoneyReportHeaderandMoneyRequestReportPreviewContent.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.47 remaining items
melvin-bot commentedon Apr 18, 2026
Current assignees @Pujan92 and @aimane-chnaif are eligible for the External assigner, not assigning anyone new.
[-][Due for payment 2026-04-17] LHN - Negative expenses show "Mark as paid" action but "Pay" badge is not visible on LHN.[/-][+][$250] [Due for payment 2026-04-17] LHN - Negative expenses show "Mark as paid" action but "Pay" badge is not visible on LHN.[/+]melvin-bot commentedon Apr 18, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022045485815877973993
mallenexpensify commentedon Apr 18, 2026
Payment Summary
Contributor+: @aimane-chnaif paid $250 via Upwork
Contributor+: @Pujan92 due $250 via NewDot
@aimane-chnaif can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022045485815877973993
^ Test case created
melvin-bot commentedon Apr 19, 2026
📣 @Daddaabdelghafour! 📣
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:
Daddaabdelghafour commentedon Apr 19, 2026
Proposal for Issue #85187 — LHN: Negative expenses show "Mark as paid" action but "Pay" badge is not visible**
Root Cause Analysis
The issue is a conditional rendering mismatch between two separate logic paths:
amount > 0(or similar), which incorrectly excludes negative expense amountsThese two conditions should be in sync — if the action is shown, the badge must be shown too.
Fix Approach
SidebarUtils.tsor the relevant report/transaction selector that determines badge visibilityTesting Plan**
Contributor details
Expensify account email: abroud498@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/abdelghafourd2
mallenexpensify commentedon Apr 20, 2026
@Daddaabdelghafour please familiarize yourself with CONTRIBUTING.md before posting or risked being removed. Thx
aimane-chnaif commentedon Apr 20, 2026
@mallenexpensify accepted offer
mallenexpensify commentedon Apr 21, 2026
@aimane-chnaif paid, summary updated above. Thx.
twisterdotcom commentedon Apr 24, 2026
$250 approved for @Pujan92 in Report ID: R0001xroe4rH.
Zapier Logs
Run ID: 00040eee-eb44-a838-1564-d47fd29c2304SO: https://stackoverflowteams.com/c/expensify/questions/7582