Skip to content

Reports - Reject report level is not shown when bulk rejecting expense #86836

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.51-1
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: #84853
Email or phone of affected tester (no customers): soidnjonjdisojosj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Search

Action Performed:

Precondition:

  • User A invites User B and User C to the workspace.
  • Edit default approval workflow so that User B is the first approver and User A is the last approver.
  1. Go to staging.new.expensify.com
  2. [User C] Create an expense in workspace chat and click Submit.
  3. [User B] Open User C's expense report and click Approve.
  4. [User A] Open User C's expense report.
  5. [User A] Click More > Reject.
    → Reject report level is shown - Expected.
  6. [User A] Go to Reports > Expenses.
  7. [User A] Select User C's expense via checkbox.
  8. [User A] Click dropdown button > Reject.

Expected Result:

Reject report level will be shown when bulk rejecting expense.

Actual Result:

Reject report level is not shown when bulk rejecting expense.

This issue also happens when user rejects one of the expenses in multi-expense report, reject report level is missing.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 1, 2026
  2. melvin-bot commented on Apr 1, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #84853

  3. melvin-bot commented on Apr 1, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 1, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. OSBotify commented on Apr 1, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #84853 - "feat: Release 3 - add reject report level" by @truph01 (High confidence)
    Related Issues: N/A

    Recommendation: ROLL FORWARD

    The PR introduced a new report-level rejection flow that includes user selection (last approver vs submitter), but the implementation is incomplete. The new flow was only integrated for single-report rejection via MoneyReportHeader, but bulk rejection from Search still uses the old flow which bypasses the new UI.

    The fix should be straightforward: update the bulk rejection flow in Search to also navigate through the new RejectExpenseReportPage when rejecting full reports, or alternatively, add the user selection logic to the existing SearchRejectReasonPage.

    Labels: No label changes needed - this is a frontend bug and DeployBlockerCash should remain.

    Detailed Analysis

    Evidence

    PR #84853 added a comprehensive report-level rejection feature that includes:

    • New route: REJECT_EXPENSE_REPORT → RejectExpenseReportPage
    • User selection UI allowing rejectors to choose between:
      • Last approver (if there was a previous FORWARDED action)
      • Submitter (report owner)
    • New form: REPORT_REJECT_FORM with comment and target selection

    The PR modified MoneyReportHeader.tsx to navigate to this new page:

    if (moneyRequestReport?.reportID) {
        Navigation.navigate(ROUTES.REJECT_EXPENSE_REPORT.getRoute(moneyRequestReport.reportID));
    }

    Root Cause

    The bug occurs because the bulk rejection flow was not updated.

    When rejecting from Search (bulk or single expense):

    1. User selects expense(s) and clicks "Reject" in the dropdown
    2. Code navigates to ROUTES.SEARCH_REJECT_REASON_RHP (line 979 in useSearchBulkActions.ts)
    3. This shows SearchRejectReasonPage which only asks for a comment
    4. It calls rejectMoneyRequestsOnSearch which does transaction-level rejection
    5. The new report-level selection UI is completely bypassed

    When rejecting from the report header (single report):

    1. User clicks More > Reject
    2. Code navigates to ROUTES.REJECT_EXPENSE_REPORT
    3. Shows the new RejectExpenseReportPage with user selection UI
    4. Works as expected

    Verification

    Confirmed that:

    Files Affected

    • /src/pages/RejectExpenseReportPage.tsx - New page with user selection (only used from MoneyReportHeader)
    • /src/hooks/useSearchBulkActions.ts - Bulk rejection flow (not updated, still uses old path)
    • /src/pages/Search/SearchRejectReasonPage.tsx - Old rejection page (still used for bulk, missing user selection)
  6. MelvinBot commented on Apr 1, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #84853 added a new RejectExpenseReportPage that allows an approver to choose who to return a rejected report to (previous approver or submitter). However, this page is only navigated to from the report header's three-dot menu (MoneyReportHeader.tsx:2148-2162).

    The bulk reject flows from Search use a completely different code path:

    1. Search bulk actions (useSearchBulkActions.ts:961-984) navigates to SEARCH_REJECT_REASON_RHP → renders SearchRejectReasonPage → calls rejectMoneyRequestsOnSearch() which performs transaction-level rejection (rejectMoneyRequest/rejectMoneyRequestInBulk).
    2. Selection mode within a report (useSelectedTransactionsActions.ts:290-306) navigates to SEARCH_MONEY_REQUEST_REPORT_REJECT_TRANSACTIONS → same SearchRejectReasonPage → same transaction-level rejection.

    Neither of these flows navigates to RejectExpenseReportPage or calls rejectExpenseReport(). They always perform transaction-level rejection, so the user never sees the target selection UI (previous approver vs submitter).

    What changes do you think we should make in order to solve the problem?

    The bulk reject flows need to detect when the rejection is effectively a report-level reject and navigate to RejectExpenseReportPage instead of SearchRejectReasonPage.

    Specifically:

    1. In useSearchBulkActions.ts: When the selected expenses all belong to a single report where canRejectReportAction returns true, the onSelected handler for the reject option should navigate to ROUTES.REJECT_EXPENSE_REPORT.getRoute(reportID) instead of ROUTES.SEARCH_REJECT_REASON_RHP.

    2. In useSelectedTransactionsActions.ts: Similarly, when the selection represents a report-level reject scenario (user is manager, report is processing), navigate to ROUTES.REJECT_EXPENSE_REPORT.getRoute(reportID) instead of ROUTES.SEARCH_MONEY_REQUEST_REPORT_REJECT_TRANSACTIONS.

    This ensures the report-level reject page with target selection is shown in all contexts where the user is performing a report-level rejection, not just from the report header menu.

    What alternative solutions did you explore? (Optional)

    An alternative would be to add the target selection (previous approver vs submitter) directly into SearchRejectReasonPage. However, this would duplicate logic already in RejectExpenseReportPage and create maintenance burden. Reusing the existing page by navigating to it is cleaner and consistent.


    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.

  7. lakchote commented on Apr 1, 2026

    @lakchote
    Contributor

    Not planned for the moment. We can close this one.

    Image

    cc @garrettmknight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringHourlyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions