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 2025-11-18] [$250] Reports - Dropdown menu shows "Approve" when one of the selected expenses is already approved #73879
Version Number: 9.2.41-2 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: Exploratory Email or phone of affected tester (no customers):sdniosjsdonsj@gmail.com Issue reported by: Applause Internal Team Device used: Mac 15.5 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Create two expenses.
Click Submit and Approve.
Create another expense.
Click Submit.
Go to Reports > Reports.
Expand both report rows.
Select one of the expenses from approved report (from Step 4) and select the unapproved expense (from Step 6).
Click dropdown button.
Expected Result:
Dropdown menu will not show Approve button because one of the selected expenses is already approved.
Actual Result:
Dropdown menu still shows Approve button when one of the selected expenses is already approved.
This issue does not happen if user selects all expenses from both reports.
Note: we can do the same with other actions that has the same problems
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
Dropdown menu still shows Approve button when one of the selected expenses is already approved.
What is the root cause of that problem?
The selectedReports is only added if we select all transactions of a report. In our case, we select a submitted report and one transaction from the approved report, so selectedReports only include the submitted report and. then the approve button is shown.
What changes do you think we should make in order to solve the problem?
Only using selectedTransactionsKeys is incorrect, because when it's grouped by reports, the action is View. Instead, we should check if all selected transactions are included in selectedReports or not. This check ensures that the bulk action like approve doesn't show if we do not select the whole report because we can't approve the transaction individually. We can do the same for other bulk actions that can only be done for the whole report.
const areSelectedTransactionsIncludedInReports = selectedTransactionsKeys.every((id) => selectedReportIDs.includes(selectedTransactions[id].reportID));
// Otherwise, we provide the full set of options depending on the state of the selected transactions and reports
const shouldShowApproveOption =
!isOffline &&
!isAnyTransactionOnHold &&
areSelectedTransactionsIncludedInReports &&
(selectedReports.length
? selectedReports.every((report) => report.allActions.includes(CONST.SEARCH.ACTION_TYPES.APPROVE))
: selectedTransactionsKeys.every((id) => selectedTransactions[id].action === CONST.SEARCH.ACTION_TYPES.APPROVE));
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Reports - Dropdown menu shows "Approve" when one of the selected expenses is already approved[/-][+][$250] Reports - Dropdown menu shows "Approve" when one of the selected expenses is already approved[/+]on Oct 31, 2025
@nkdengineer could you please give an example where selectedTransactionsKeys fails? I tried selecting a single transaction from a report, but the Approve button doesn’t show up.
changed the title [-][$250] Reports - Dropdown menu shows "Approve" when one of the selected expenses is already approved[/-][+][Due for payment 2025-11-18] [$250] Reports - Dropdown menu shows "Approve" when one of the selected expenses is already approved[/+]on Nov 11, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.48-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@jayeshmangwani@Christinadobrzyn The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Oct 30, 2025
Triggered auto assignment to @Christinadobrzyn (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.daledah commentedon Oct 30, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Dropdown menu still shows Approve button when one of the selected expenses is already approved.
What is the root cause of that problem?
Because we selected one report that hasn’t been approved yet and one transaction from an approved report, we’re failing this condition.
App/src/pages/Search/SearchPage.tsx
Lines 355 to 360 in 3be2823
What changes do you think we should make in order to solve the problem?
We should update this condition to use
selectedTransactionsKeyslike we did with other actionsApp/src/pages/Search/SearchPage.tsx
Lines 355 to 360 in 3be2823
We should update other places that use
selectedReportscondition as wellApp/src/pages/Search/SearchPage.tsx
Lines 374 to 377 in 3be2823
App/src/pages/Search/SearchPage.tsx
Lines 388 to 391 in 3be2823
Note: we can do the same with other actions that has the same problems
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
nkdengineer commentedon Oct 31, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Dropdown menu still shows Approve button when one of the selected expenses is already approved.
What is the root cause of that problem?
The
selectedReportsis only added if we select all transactions of a report. In our case, we select a submitted report and one transaction from the approved report, soselectedReportsonly include the submitted report and. then the approve button is shown.App/src/pages/Search/SearchPage.tsx
Lines 355 to 368 in 72062d4
What changes do you think we should make in order to solve the problem?
Only using
selectedTransactionsKeysis incorrect, because when it's grouped by reports, theactionisView. Instead, we should check if all selected transactions are included inselectedReportsor not. This check ensures that the bulk action like approve doesn't show if we do not select the whole report because we can't approve the transaction individually. We can do the same for other bulk actions that can only be done for the whole report.App/src/pages/Search/SearchPage.tsx
Lines 355 to 368 in 72062d4
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Reports - Dropdown menu shows "Approve" when one of the selected expenses is already approved[/-][+][$250] Reports - Dropdown menu shows "Approve" when one of the selected expenses is already approved[/+]melvin-bot commentedon Oct 31, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021984369165659568760
melvin-bot commentedon Oct 31, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (
External)jayeshmangwani commentedon Nov 3, 2025
@nkdengineer could you please give an example where
selectedTransactionsKeysfails? I tried selecting a single transaction from a report, but the Approve button doesn’t show up.nkdengineer commentedon Nov 3, 2025
@jayeshmangwani Here is the case where this check fails. The
Approvebutton doesn't show because the action of selected transaction isView.Screen.Recording.2025-11-03.at.13.31.45.mov
13 remaining items
[-][$250] Reports - Dropdown menu shows "Approve" when one of the selected expenses is already approved[/-][+][Due for payment 2025-11-18] [$250] Reports - Dropdown menu shows "Approve" when one of the selected expenses is already approved[/+]melvin-bot commentedon Nov 11, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Nov 11, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.48-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-11-18. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Nov 11, 2025
@jayeshmangwani @Christinadobrzyn The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Christinadobrzyn commentedon Nov 18, 2025
@jayeshmangwani do we need a regression test?
Payment summary - #73879 (comment)
mountiny commentedon Nov 19, 2025
I dont think we need a new one for this case
Christinadobrzyn commentedon Nov 19, 2025
Ok sounds good - payment summary is here - #73879 (comment)
Both payments are through ND so closing this.
trjExpensify commentedon Dec 3, 2025
approved $250 for @jayeshmangwani
twisterdotcom commentedon Mar 11, 2026
@nkdengineer has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-ebcb-a18d-970e-26ce29281974