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-05-20] [$250] Showing option to pay non-reimbursable on reports list #88549
Version Number: 9.3.61-2 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@joekaufmanexpensify Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Create a report with only non-reimbursable expenses on a workspace with payments enabled
Submit the report and approve it as an admin
Go to the Spend page and tap All reports
Expected Result:
The report action button is View on the report list.
Note: we still want to show the option to Mark as paid these reports inside the report itself or in the report preview, per this PR. They will also remain available in bulk pay.
Actual Result:
The report action button is Pay in the report list.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
PR #87552 changed the logic in SearchUIUtils.ts:getActions() so that shouldOnlyShowElsewhere is no longer filtered out for non-reimbursable-only reports. Previously there was an explicit exclusion (&& !reportHasOnlyNonReimbursableTransactions) on that flag, which prevented PAY from being added as a list-level action for these reports. After the PR simplified this to shouldOnlyShowElsewhere = !canBePaid && canOnlyBePaidElsewhere, non-reimbursable-only approved reports now trigger PAY in the search list because canIOUBePaid returns true when onlyShowPayElsewhere=true via the isOnlyNonReimbursablePayElsewhere condition.
What changes do you think we should make in order to solve the problem?
In SearchUIUtils.ts around line 2317, when deciding whether to push PAY into allActions, add a check that excludes reports with only non-reimbursable transactions from showing the Pay button on the list. Specifically, when shouldOnlyShowElsewhere is true but the report has only non-reimbursable transactions (via hasOnlyNonReimbursableTransactions), do not add PAY as an action. This preserves the "Mark as paid" option inside the report detail view and in bulk pay (which use different code paths) while showing "View" on the report list.
What alternative solutions did you explore?
An alternative would be to modify canIOUBePaid in ReportWorkflow.ts to accept a context parameter distinguishing list vs detail views. However, this would add complexity to a widely-used utility function. The simpler approach is to filter at the call site in SearchUIUtils.ts since that's the only place where the list-level distinction matters.
Related issue:#87762 ("Pinned pay action in LHN for non-reimbursable report") appears to be the same underlying problem manifesting in the LHN context.
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.
Please re-state the problem that we are trying to solve in this issue.
On the Spend page > All reports list, the action button shows Pay for reports that contain only non-reimbursable expenses. The expected button is View, since #87552 intentionally restricts the bulk/listing pay surfaces for non-reimbursable-only reports while keeping Mark as paid available inside the report itself and inside the report preview.
What is the root cause of that problem?
The reports list resolves the per-row action via getActions in SearchUIUtils.ts. It evaluates two flavors of canIOUBePaid — one that requires a usable bank account, and a second pay-elsewhere variant that only checks if the offline payer flow is available — and pushes PAY into the row's actions whenever either is satisfied:
For a report with only non-reimbursable expenses on a workspace with payments enabled, the first check returns false (no ACH path is offered for non-reimbursable, per #87552), but the pay-elsewhere check still returns true. That makes shouldOnlyShowElsewhere true, the PAY action gets pushed, and the row renders Pay instead of falling through to View.
This is the same gap that affected the LHN pay badge: the pay-elsewhere fallback fires for non-reimbursable-only reports even though those reports have been removed from the listing/queue surfaces. The LHN side was closed by gating that branch on hasOnlyNonReimbursableTransactions; the reports-list/search-action side was not touched and still leaks the PAY action.
What changes do you think we should make in order to solve the problem?
Gate the pay-elsewhere branch in getActions so it does not contribute the PAY action when the report contains only non-reimbursable transactions. Concretely, at the line that currently pushes CONST.SEARCH.ACTION_TYPES.PAY based on (canBePaid || shouldOnlyShowElsewhere), only let shouldOnlyShowElsewhere count when the report has at least one reimbursable transaction.
The action helper for this check, hasOnlyNonReimbursableTransactions, already exists in ReportUtils.ts and accepts the precomputed transactions array, so the gate can reuse the allReportTransactions already gathered above and avoids any extra Onyx lookup:
After the gate, the allActions array stays empty for non-reimbursable-only reports that have no other applicable action, and the function falls through to its default [CONST.SEARCH.ACTION_TYPES.VIEW] return at the bottom — so the row renders View as expected. The in-report Mark as paid and report preview pay action are unaffected because they live in different code paths (MoneyReportHeader, ReportPreviewActionButton, PayActionButton) and continue to use their own helpers.
What alternative solutions did you explore? (Optional)
Pushing the gate down into canIOUBePaid itself was considered, but canIOUBePaid is intentionally shared by surfaces that still want to offer pay-elsewhere for non-reimbursable (the report header, the report preview, the bulk-pay action) — those callers were preserved on purpose by #87552. Adding the non-reimbursable filter at the call site keeps the helper's contract intact and matches the surgical pattern already used for the LHN badge fix.
changed the title [-]Showing option to pay non-reimbursable on reports list[/-][+][$250] Showing option to pay non-reimbursable on reports list[/+]on Apr 22, 2026
⚠️@MobileMage Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
MelvinBot commentedon Apr 22, 2026
Proposal
What is the root cause of that problem?
PR #87552 changed the logic in
SearchUIUtils.ts:getActions()so thatshouldOnlyShowElsewhereis no longer filtered out for non-reimbursable-only reports. Previously there was an explicit exclusion (&& !reportHasOnlyNonReimbursableTransactions) on that flag, which preventedPAYfrom being added as a list-level action for these reports. After the PR simplified this toshouldOnlyShowElsewhere = !canBePaid && canOnlyBePaidElsewhere, non-reimbursable-only approved reports now triggerPAYin the search list becausecanIOUBePaidreturnstruewhenonlyShowPayElsewhere=truevia theisOnlyNonReimbursablePayElsewherecondition.What changes do you think we should make in order to solve the problem?
In
SearchUIUtils.tsaround line 2317, when deciding whether to pushPAYintoallActions, add a check that excludes reports with only non-reimbursable transactions from showing the Pay button on the list. Specifically, whenshouldOnlyShowElsewhereis true but the report has only non-reimbursable transactions (viahasOnlyNonReimbursableTransactions), do not addPAYas an action. This preserves the "Mark as paid" option inside the report detail view and in bulk pay (which use different code paths) while showing "View" on the report list.What alternative solutions did you explore?
An alternative would be to modify
canIOUBePaidinReportWorkflow.tsto accept a context parameter distinguishing list vs detail views. However, this would add complexity to a widely-used utility function. The simpler approach is to filter at the call site inSearchUIUtils.tssince that's the only place where the list-level distinction matters.Supporting evidence
Key code locations:
SearchUIUtils.ts:2311-2318—getActions()adds PAY whenshouldOnlyShowElsewhereis trueReportWorkflow.ts:212-222—canIOUBePaidreturns true for non-reimbursable-only reports viaisOnlyNonReimbursablePayElsewhereActionCell/index.tsx— renders Pay vs View button based on the action typeRelated issue: #87762 ("Pinned pay action in LHN for non-reimbursable report") appears to be the same underlying problem manifesting in the LHN context.
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.melvin-bot commentedon Apr 22, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abzokhattab (
External)wildan-m commentedon Apr 22, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On the Spend page > All reports list, the action button shows Pay for reports that contain only non-reimbursable expenses. The expected button is View, since #87552 intentionally restricts the bulk/listing pay surfaces for non-reimbursable-only reports while keeping
Mark as paidavailable inside the report itself and inside the report preview.What is the root cause of that problem?
The reports list resolves the per-row action via
getActionsinSearchUIUtils.ts. It evaluates two flavors ofcanIOUBePaid— one that requires a usable bank account, and a second pay-elsewhere variant that only checks if the offline payer flow is available — and pushesPAYinto the row's actions whenever either is satisfied:App/src/libs/SearchUIUtils.ts
Lines 2312 to 2319 in 0a3ec18
For a report with only non-reimbursable expenses on a workspace with payments enabled, the first check returns false (no ACH path is offered for non-reimbursable, per #87552), but the pay-elsewhere check still returns true. That makes
shouldOnlyShowElsewheretrue, thePAYaction gets pushed, and the row renders Pay instead of falling through to View.This is the same gap that affected the LHN pay badge: the pay-elsewhere fallback fires for non-reimbursable-only reports even though those reports have been removed from the listing/queue surfaces. The LHN side was closed by gating that branch on
hasOnlyNonReimbursableTransactions; the reports-list/search-action side was not touched and still leaks thePAYaction.What changes do you think we should make in order to solve the problem?
Gate the pay-elsewhere branch in
getActionsso it does not contribute thePAYaction when the report contains only non-reimbursable transactions. Concretely, at the line that currently pushesCONST.SEARCH.ACTION_TYPES.PAYbased on(canBePaid || shouldOnlyShowElsewhere), only letshouldOnlyShowElsewherecount when the report has at least one reimbursable transaction.The action helper for this check,
hasOnlyNonReimbursableTransactions, already exists inReportUtils.tsand accepts the precomputed transactions array, so the gate can reuse theallReportTransactionsalready gathered above and avoids any extra Onyx lookup:App/src/libs/ReportUtils.ts
Lines 2555 to 2565 in 0a3ec18
After the gate, the
allActionsarray stays empty for non-reimbursable-only reports that have no other applicable action, and the function falls through to its default[CONST.SEARCH.ACTION_TYPES.VIEW]return at the bottom — so the row renders View as expected. The in-reportMark as paidand report preview pay action are unaffected because they live in different code paths (MoneyReportHeader,ReportPreviewActionButton,PayActionButton) and continue to use their own helpers.Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/88549-spend-list-pay-nonreimbursable?expand=1
What alternative solutions did you explore? (Optional)
Pushing the gate down into
canIOUBePaiditself was considered, butcanIOUBePaidis intentionally shared by surfaces that still want to offer pay-elsewhere for non-reimbursable (the report header, the report preview, the bulk-pay action) — those callers were preserved on purpose by #87552. Adding the non-reimbursable filter at the call site keeps the helper's contract intact and matches the surgical pattern already used for the LHN badge fix.[-]Showing option to pay non-reimbursable on reports list[/-][+][$250] Showing option to pay non-reimbursable on reports list[/+]melvin-bot commentedon Apr 22, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022047046108138402412
MobileMage commentedon Apr 22, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
github-actions commentedon Apr 22, 2026
wildan-m commentedon Apr 22, 2026
Proposal updated — added compare branch with implementation.
15antonian commentedon Apr 22, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
33 remaining items
melvin-bot commentedon May 20, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon May 22, 2026
Payment Summary
Contributor: @emkhalid paid $250 via Upwork
Contributor+: @abzokhattab due $250 via NewDot
@emkhalid can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022047046108138402412
@abzokhattab plz complete the BZ checklist and tag me in a post once you have. Thx
emkhalid commentedon May 22, 2026
@mallenexpensify accepted the job, thanks
mallenexpensify commentedon May 22, 2026
@emkhalid paid, summary updated above.
@abzokhattab plz complete the BZ checklist and tag me in a post once you have. Thx
abzokhattab commentedon May 23, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment: https://github.com/Expensify/App/pull/87552/changes#r3291800401
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/640776
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-cb5a-ada1-2c30-f4f2929a3154abzokhattab commentedon May 23, 2026
@mallenexpensify done
quinthar commentedon Jun 29, 2026
Approved $250 to @abzokhattab