Skip to content

Spend - Move to report is shown when bulk selecting unreported expenses with paid expense #97923

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.51-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #96482
Email or phone of affected tester (no customers): sdsiodjnosdjiodsj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Submit, approve and pay the expense.
  5. Go to self DM.
  6. Create 60 unreported expenses.
  7. Go to Spend > Expenses.
  8. Click Select all checkbox > Select all.
  9. Click dropdown button > Move to report.
  10. Click Create report.

Expected Result:

Move to report option should be hidden when paid expense is selected.

Actual Result:

Move to report is shown when bulk selecting unreported expenses with paid expense.
After creating a new report, the unreported expenses remain unreported instead of moving to the new report.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

To be added by Applause Leads

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7226962

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 6, 2026
  2. applause-bot commented on Aug 6, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/45ffbe9e44d24e09fee67d4c96321742eed013462ac17636c7dfff0430a32dce

  3. melvin-bot commented on Aug 6, 2026

    @melvin-bot

    @mjasikowski recently merged #96482, but they are OOO right now, so I'll auto-assign someone else.

  4. melvin-bot commented on Aug 6, 2026

    @melvin-bot

    Triggered auto assignment to @inimaga (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. melvin-bot commented on Aug 6, 2026

    @melvin-bot

    @mjasikowski @ZhenjaHorbach you have been assigned to this deploy blocker because you reviewed the offending PR: #96482

  6. melvin-bot commented on Aug 6, 2026

    @melvin-bot

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

  7. github-actions commented on Aug 6, 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.
  8. MelvinBot commented on Aug 6, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #96482 — "Allow moving all matching expenses to a report from Search" by mjasikowski (High confidence)
    Related issues: None

    Recommendation: REVERT

    #96482 newly exposed "Move expenses" in the Select all matching path using a client-side eligibility gate that only sees the loaded page (first 50 results). A paid / non-movable expense outside that page is missed, so the option is wrongly shown; the backend then moves nothing. Reverting cleanly restores the prior safe behavior (option hidden for select-all-matching).

    Assignees: mjasikowski (PR author) and ZhenjaHorbach (approving reviewer) are already assigned — no change needed.
    Labels: No change — DeployBlockerCash kept (App deploy correctly blocked; staging-only, not on production).

    📋 Detailed analysis

    Evidence

    Root cause

    The eligibility gate in src/hooks/useSearchBulkActions.ts:1859-1860:

    const canAllTransactionsBeMoved = selectedTransactionsKeys.length > 0 && selectedTransactionsKeys.every((id) => selectedTransactions[id].canChangeReport);
    const canMoveExpenses = canAllTransactionsBeMoved && !moveHasMultipleOwners && !isExpenseReportType;

    is now used to expose the option in the all-matching path at src/hooks/useSearchBulkActions.ts:1878-1880:

    if (areAllMatchingItemsSelected) {
        return canMoveExpenses ? [exportButtonOption, moveExpensesOption] : [exportButtonOption];
    }

    selectedTransactionsKeys.every((id) => ...canChangeReport) only evaluates the loaded page (RESULTS_PAGE_SIZE = 50). In the repro there are 61 transactions (1 paid + 60 unreported); the paid expense (canChangeReport === false) is off-page, so canMoveExpenses evaluates true and "Move to report" is shown.

    On "Create report", the whole matching set is sent to the backend via jsonQuery + hash (new all-matching path added by the PR in SearchTransactionsChangeReport.tsx → changeTransactionsReport in Transaction.ts). The backend can't move a set that includes a paid expense, so the unreported expenses stay unreported — matching the reported "Actual Result." The PR's own comment acknowledges the gate is "best-effort" and relies on the backend, but the backend does not gracefully move only the eligible subset.

    Roll-forward alternative (if a full revert isn't preferred)

    Restore the old early-return so the option isn't offered for all-matching selections the client can't validate:

    if (areAllMatchingItemsSelected) {
        return [exportButtonOption];
    }

    This effectively disables the feature the PR added; properly re-enabling it requires backend support to move only the eligible expenses in a mixed all-matching set and surface that to the user. Given this is an active deploy blocker, a full revert is the cleaner default.

  9. self-assigned this
    on Aug 6, 2026
  10. arosiclair commented on Aug 6, 2026

    @arosiclair
    Contributor

    We CP'd the revert, but it failed partially because of a GH outage

  11. arosiclair commented on Aug 6, 2026

    @arosiclair
    Contributor

    Revert is on web so I asked for a retest here

  12. m-natarajan commented on Aug 6, 2026

    @m-natarajan

    Move to report option not displayed, Win 11/chrome, v9.4.51-1

    Recording.3330.mp4
    bandicam.2026-08-06.16-36-51-261.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringHourlyKSv2ReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions