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-04-20] [$250] Don't show non-reimbursable reports in the Pay to-do queu #87351
The Pay to-do queue count is driven by isPrimaryPayAction() in ReportPrimaryActionUtils.ts:225-230. The condition explicitly includes reports that have only non-reimbursable transactions:
The second branch of that OR means any finished expense report where all transactions are non-reimbursable will appear in the Pay queue, even though there is nothing to reimburse.
Notably, the ForYouSection Pay handler already passes {reimbursable: YES} when navigating to search results (index.tsx:90), so the count and the actual search results are mismatched — the badge shows a number, but the results page filters those reports out.
What changes do you think we should make in order to solve the problem?
This is safe because useNonReimbursablePaymentModal already blocks direct payment for non-reimbursable-only reports, confirming they should not have a Pay action.
What alternative solutions did you explore? (Optional)
An alternative would be to filter non-reimbursable reports only in the todo queue logic (todos.ts:67-79) rather than in isPrimaryPayAction itself. However, fixing it at the source (isPrimaryPayAction) is cleaner since the Pay action genuinely does not apply to non-reimbursable-only reports — the payment modal already blocks it.
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 [-]Don't show non-reimbursable reports in the `Pay` to-do queu[/-][+][$250] Don't show non-reimbursable reports in the `Pay` to-do queu[/+]on Apr 8, 2026
Please re-state the problem that we are trying to solve in this issue.
Non-reimbursable expense reports are appearing in the "Pay" to-do queue, but users cannot actually pay these reports since they are marked as non-reimbursable. This creates confusion and clutter in the to-do list.
What is the root cause of that problem?
The Pay to-do queue filtering logic (likely in src/libs/ReportUtils.ts or src/libs/TodoUtils.ts) doesn't exclude reports with reimbursable: false when determining which reports should appear in the Pay queue. The filter checks for report state (Outstanding, approved, etc.) but skips the reimbursable status check.
What changes do you think we should make in order to solve the problem?
In the to-do queue filter function (likely shouldShowPaymentReminderInTodoList() or similar in src/libs/ReportUtils.ts), add a check to exclude non-reimbursable reports:
// Before: Only checks report statefunctionshouldShowPaymentReminderInTodoList(report: Report): boolean{returnisOutstandingReport(report)&&isReportApproved(report);}// After: Also checks if reimbursablefunctionshouldShowPaymentReminderInTodoList(report: Report): boolean{return(isOutstandingReport(report)&&isReportApproved(report)&&report.reimbursable!==false// Exclude non-reimbursable);}
Or if the logic is in a different filter path (e.g., getReportsToPayQueued() in actions), add the same reimbursable check there.
What alternative solutions did you explore? (Optional)
Show non-reimbursable reports with disabled state: Still clutters the queue
Please re-state the problem that we are trying to solve in this issue.
Expense reports where all transactions are non-reimbursable (e.g., company card expenses) appear in the Pay to-do queue, even though there is nothing to reimburse.
What is the root cause of that problem?
The Pay to-do queue is populated in todos by checking isPrimaryPayAction() in ReportPrimaryActionUtils. That function returns true for reports with only non-reimbursable transactions due to this condition:
The second branch was intentionally added to support "mark as paid" on non-reimbursable reports when viewing them directly. The problem is that the to-do queue also picks these up, creating a misleading Pay count.
What changes do you think we should make in order to solve the problem?
Filter out non-reimbursable-only reports in todos when building the reportsToPay list. After the isPrimaryPayAction() check, add a guard that excludes reports where hasOnlyNonReimbursableTransactions() is true:
What alternative solutions did you explore? (Optional)
MelvinBot's proposal removes the non-reimbursable branch from isPrimaryPayAction() entirely. That's over-scoped — the hasOnlyNonReimbursableTransactions branch was intentionally added (commit 55137f357ff) to allow "mark as paid" on non-reimbursable reports when a user views them directly. Gutting it from isPrimaryPayAction() would remove that capability everywhere, not just from the to-do queue. Filtering in todos.ts is more targeted: it fixes the to-do queue without regressing the direct report Pay/mark-as-paid flow.
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: new feature
[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:
[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
samranahm commentedon Apr 8, 2026
I recently worked on this, I'm open to this one too.
cc:@situchan
MelvinBot commentedon Apr 8, 2026
Proposal
What is the root cause of that problem?
The Pay to-do queue count is driven by
isPrimaryPayAction()inReportPrimaryActionUtils.ts:225-230. The condition explicitly includes reports that have only non-reimbursable transactions:The second branch of that OR means any finished expense report where all transactions are non-reimbursable will appear in the Pay queue, even though there is nothing to reimburse.
Notably, the ForYouSection Pay handler already passes
{reimbursable: YES}when navigating to search results (index.tsx:90), so the count and the actual search results are mismatched — the badge shows a number, but the results page filters those reports out.What changes do you think we should make in order to solve the problem?
Remove the non-reimbursable branch from the condition in
isPrimaryPayAction()atReportPrimaryActionUtils.ts:230, changing:to simply:
This is safe because
useNonReimbursablePaymentModalalready blocks direct payment for non-reimbursable-only reports, confirming they should not have a Pay action.What alternative solutions did you explore? (Optional)
An alternative would be to filter non-reimbursable reports only in the todo queue logic (
todos.ts:67-79) rather than inisPrimaryPayActionitself. However, fixing it at the source (isPrimaryPayAction) is cleaner since the Pay action genuinely does not apply to non-reimbursable-only reports — the payment modal already blocks it.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 8, 2026
Current assignee @situchan is eligible for the External assigner, not assigning anyone new.
[-]Don't show non-reimbursable reports in the `Pay` to-do queu[/-][+][$250] Don't show non-reimbursable reports in the `Pay` to-do queu[/+]melvin-bot commentedon Apr 8, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022041816085132038141
Abdullahtmk commentedon Apr 8, 2026
Please re-state the problem that we are trying to solve in this issue.
Non-reimbursable expense reports are appearing in the "Pay" to-do queue, but users cannot actually pay these reports since they are marked as non-reimbursable. This creates confusion and clutter in the to-do list.
What is the root cause of that problem?
The Pay to-do queue filtering logic (likely in
src/libs/ReportUtils.tsorsrc/libs/TodoUtils.ts) doesn't exclude reports withreimbursable: falsewhen determining which reports should appear in the Pay queue. The filter checks for report state (Outstanding, approved, etc.) but skips the reimbursable status check.What changes do you think we should make in order to solve the problem?
In the to-do queue filter function (likely
shouldShowPaymentReminderInTodoList()or similar insrc/libs/ReportUtils.ts), add a check to exclude non-reimbursable reports:Or if the logic is in a different filter path (e.g.,
getReportsToPayQueued()in actions), add the same reimbursable check there.What alternative solutions did you explore? (Optional)
twilight2294 commentedon Apr 8, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense reports where all transactions are non-reimbursable (e.g., company card expenses) appear in the Pay to-do queue, even though there is nothing to reimburse.
What is the root cause of that problem?
The Pay to-do queue is populated in todos by checking
isPrimaryPayAction()in ReportPrimaryActionUtils. That function returnstruefor reports with only non-reimbursable transactions due to this condition:The second branch was intentionally added to support "mark as paid" on non-reimbursable reports when viewing them directly. The problem is that the to-do queue also picks these up, creating a misleading Pay count.
What changes do you think we should make in order to solve the problem?
Filter out non-reimbursable-only reports in todos when building the
reportsToPaylist. After theisPrimaryPayAction()check, add a guard that excludes reports wherehasOnlyNonReimbursableTransactions()is true:What alternative solutions did you explore? (Optional)
MelvinBot's proposal removes the non-reimbursable branch from
isPrimaryPayAction()entirely. That's over-scoped — thehasOnlyNonReimbursableTransactionsbranch was intentionally added (commit55137f357ff) to allow "mark as paid" on non-reimbursable reports when a user views them directly. Gutting it fromisPrimaryPayAction()would remove that capability everywhere, not just from the to-do queue. Filtering intodos.tsis more targeted: it fixes the to-do queue without regressing the direct report Pay/mark-as-paid flow.samarroy84 commentedon Apr 8, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-04-08 10:47:41 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Non-reimbursable reports are displayed in the Pay to-do queue
What is the root cause of that problem?
App/src/libs/ReportPrimaryActionUtils.ts
Lines 225 to 233 in d1dbbcb
Here, return true if report has only non-reimbursable transactions with non-zero amount.
So this report is pushed to Pay todo section
App/src/libs/actions/OnyxDerived/configs/todos.ts
Lines 67 to 79 in d1dbbcb
What changes do you think we should make in order to solve the problem?
In
isPrimaryPayActionfunction, return false if report has only non-reimbursable transactions and if this is coming from todo section check.We can introduce new
isFromTodosflag inisPrimaryPayAction. This way, we don't need to recomputehasOnlyNonReimbursableTransactionsin todo section.App/src/libs/ReportPrimaryActionUtils.ts
Lines 225 to 233 in d1dbbcb
My proposal also removes redundant check here by early returning when
hasOnlyNonReimbursableTransactions= true andnonReimbursableSpend= 0.What alternative solutions did you explore? (Optional)
JasimMalook commentedon Apr 8, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
29 remaining items
brianlee-expensify commentedon Apr 13, 2026
@situchan can you confirm whether this GH is a duplicate?
situchan commentedon Apr 13, 2026
Not dupe. Different issue
melvin-bot commentedon Apr 16, 2026
@situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Apr 19, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon Apr 21, 2026
Payment Summary
Contributor: @twilight2294 paid $250 via Upwork
Contributor+: @situchan due $250 via NewDot
@situchan plz complete the BZ checklist and tag me in a post once you have. Thx
situchan commentedon Apr 21, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: new feature
[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:
[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/626831
Regression Test Proposal
Test:
/searchand selectPayfrom the Todo sectionDo we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-ab9c-a66e-8fb4-ca48fb597ca4situchan commentedon Apr 21, 2026
@mallenexpensify checklist completed
laurenreidexpensify commentedon Apr 27, 2026
$250 approved for @situchan