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
Spend - Move to report option is only shown after loading all unreported expenses #102309
Version Number: 9.4.94-0 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:#98411 Email or phone of affected tester (no customers):jsdoijnodsdisojo@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:
Precondition:
Create more than 50 unreported expenses.
Go to staging.new.expensify.com
Go to Account > Troubleshoot > Clear cache and restart > Reset and refresh.
Go to Spend > Expenses.
Bulk select all unreported expenses > Select all.
→ Move to report option is missing.
Scroll down to load all expenses.
→ Move to report option is shown.
Expected Result:
In Step 4, Move to report option will be shown after selecting all unreported expenses.
Actual Result:
In Step 4, Move to report option is not shown after selecting all unreported expenses.
In Step 5, Move to report option is only shown after loading all unreported expenses.
👋 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:
Identify the pull request that introduced this issue and revert it.
Verdict: not a regression. I recommend demoting this, not reverting.Support 'Select all matching' when moving expenses to a report hides the option on purpose when some matching expenses haven't loaded yet. Production never offered "Move to report" after "Select all", so staging is still an improvement.
Workaround: Filter Status to Unreported (status:unreported). The option then appears right after "Select all", with no scrolling.
The option shows only if isEmptyObject(excludedTransactions) && (!hasUnloadedMatchingExpenses || isUnreportedOnlyQuery).
hasUnloadedMatchingExpenses is hasMoreResults. It is true while fewer than all 50+ expenses are loaded.
The default Spend > Expenses query has no status:unreported filter, so isUnreportedOnlyQuery is false.
After you scroll to the end, hasMoreResults becomes false and the option appears. This matches the report.
Why it's intended: The backend rejects the whole move if any matching expense can't be moved. The client can't check expenses it hasn't loaded, so it offers the option only when it can guarantee every match is movable.
Show "Move to report" disabled, with a tooltip suggesting the Unreported filter, when unloaded matches exist. This is a small change to the condition above.
Always show it and rely on the backend's check. This needs a clear, recoverable backend error.
Fetch the remaining pages, or ask the backend whether every match is movable, before enabling it.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.
I'm not sure this is a regression from the PR, since verification after merging main still works as expected. @MelvinBot let's analyze more related issue update condition to show 'Move to Report Action' action from this commit. I'll double check in an hour.
I'm not sure this is a regression from the PR, since verification after merging main still works as expected. @MelvinBot let's analyze more related issue update condition to show 'Move to Report Action' action from this commit. I'll double check in an hour.
suneox Agreed. This isn't a regression from the merge. The merge in dc3215e didn't change the "Move to report" condition. Your verification and the QA report differ because of one step:
The PR's QA steps apply the Unreported status filter (step 2). The query then includes status:unreported, so the option appears right away.
QA skipped that filter and used the default Spend > Expenses query, type:expense with no status. With more than 50 expenses, not all of them load at first. The client can't confirm the unloaded ones are movable, so it hides the option until everything loads.
Recommendation: close this as expected behavior, or demote it, and point QA at the PR's filtered steps. To show Move on the unfiltered view, relax the gate in a follow-up. The risk is that one expense the backend can't move rejects the entire move.
Condition history and evidence
The condition:isEmptyObject(excludedTransactions) && (!hasUnloadedMatchingExpenses || isUnreportedOnlyQuery)
In useSearchBulkActions.ts, main added downloadPDFOption and the PR added moveExpensesOption. The resolution kept both and didn't change the Move condition.
In SearchQueryProvider.tsx:29-42, only how queryJSON is restored changed. Status parsing and hasMoreResults are the same.
No later commit on main or staging touches this file.
Why QA sees the option after scrolling:
The default Spend > Expenses query comes from buildCannedSearchQuery() (SearchSuggestionUtils.ts:158) and has no status filter. So isUnreportedOnlyQuery is false.
hasUnloadedMatchingExpenses is hasMoreResults. It stays true until every page loads, then becomes false, and Move appears.
canMoveExpenses isn't the cause. QA saw Move with all rows loaded, and every row is the same user's unreported expense, so the first 50 pass too.
Why your check passed: your QA steps, which are also in the PR body, include "Filter expenses by Unreported status filter." That makes isUnreportedOnlyQuery true. I couldn't view the video, so I haven't confirmed the filter chip in it.
Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.
From the initial implementation we only support unreported expenses on the BE, as required by the original issue, we must apply the unreported status filter in step 3, and test step 2 from the PR also mentions this filter: Filter expenses by Unreported status filter. Therefore I think this is not a regression bug
This issue has the same root cause as the raised issue. without the unreported filter, we cannot determine which expenses violate the rule. If we decide to enhance this behavior without the unreported filter I think it should be tracked in a separate issue
Activity
applause-bot commentedon Sep 25, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/8ec7bd5785c0967dbc08505abacd1022729a7e5e015375f2eb95a9dc633bf177
melvin-bot commentedon Sep 25, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #98411
github-actions commentedon Sep 25, 2026
👋 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:
melvin-bot commentedon Sep 25, 2026
@mjasikowski @suneox you have been assigned to this deploy blocker because you reviewed the offending PR: #98411
melvin-bot commentedon Sep 25, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Sep 25, 2026
Deploy Blocker Analysis
Verdict: not a regression. I recommend demoting this, not reverting. Support 'Select all matching' when moving expenses to a report hides the option on purpose when some matching expenses haven't loaded yet. Production never offered "Move to report" after "Select all", so staging is still an improvement.
Workaround: Filter Status to Unreported (
status:unreported). The option then appears right after "Select all", with no scrolling.Investigation details
Mechanism (
useSearchBulkActions.ts:1940-1945,useSearchBulkActions.ts:2453-2468):isEmptyObject(excludedTransactions) && (!hasUnloadedMatchingExpenses || isUnreportedOnlyQuery).hasUnloadedMatchingExpensesishasMoreResults. It is true while fewer than all 50+ expenses are loaded.status:unreportedfilter, soisUnreportedOnlyQueryis false.hasMoreResultsbecomes false and the option appears. This matches the report.Why it's intended: The backend rejects the whole move if any matching expense can't be moved. The client can't check expenses it hasn't loaded, so it offers the option only when it can guarantee every match is movable.
Why it's not a regression: Before this PR, the "Select all" path offered only Pay, Export, and Download PDF. Reverting would remove the whole feature from [$250] "Select all matching" does not allow adding all matching expenses to a report and bring back the original bug.
Possible follow-ups (not blockers):
Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis.suneox commentedon Sep 25, 2026
I'm not sure this is a regression from the PR, since verification after merging main still works as expected. @MelvinBot let's analyze more related issue update condition to show 'Move to Report Action' action from this commit. I'll double check in an hour.
suneox commentedon Sep 25, 2026
@MelvinBot
MelvinBot commentedon Sep 25, 2026
suneoxAgreed. This isn't a regression from the merge. The merge indc3215edidn't change the "Move to report" condition. Your verification and the QA report differ because of one step:status:unreported, so the option appears right away.type:expensewith no status. With more than 50 expenses, not all of them load at first. The client can't confirm the unloaded ones are movable, so it hides the option until everything loads.Recommendation: close this as expected behavior, or demote it, and point QA at the PR's filtered steps. To show Move on the unfiltered view, relax the gate in a follow-up. The risk is that one expense the backend can't move rejects the entire move.
Condition history and evidence
The condition:
isEmptyObject(excludedTransactions) && (!hasUnloadedMatchingExpenses || isUnreportedOnlyQuery)90880c4f38ed17,67bee6dpushdc3215e(merge)33be3a0(PR merged)9.4.94-0-stagingMerge conflict resolution in
dc3215e:useSearchBulkActions.ts,mainaddeddownloadPDFOptionand the PR addedmoveExpensesOption. The resolution kept both and didn't change the Move condition.SearchQueryProvider.tsx:29-42, only howqueryJSONis restored changed. Status parsing andhasMoreResultsare the same.mainorstagingtouches this file.Why QA sees the option after scrolling:
buildCannedSearchQuery()(SearchSuggestionUtils.ts:158) and has no status filter. SoisUnreportedOnlyQueryis false.hasUnloadedMatchingExpensesishasMoreResults. It stays true until every page loads, then becomes false, and Move appears.canMoveExpensesisn't the cause. QA saw Move with all rows loaded, and every row is the same user's unreported expense, so the first 50 pass too.Why your check passed: your QA steps, which are also in the PR body, include "Filter expenses by Unreported status filter." That makes
isUnreportedOnlyQuerytrue. I couldn't view the video, so I haven't confirmed the filter chip in it.Next Steps: Reply with
@MelvinBot <your feedback>to refine this analysis.suneox commentedon Sep 25, 2026
From the initial implementation we only support unreported expenses on the BE, as required by the original issue, we must
apply the unreported status filterin step 3, and test step 2 from the PR also mentions this filter:Filter expenses by Unreported status filter. Therefore I think this is not a regression bugsuneox commentedon Sep 25, 2026
CleanShot.2026-09-26.at.00.03.00.mp4
This issue has the same root cause as the raised issue. without the unreported filter, we cannot determine which expenses violate the rule. If we decide to enhance this behavior without the unreported filter I think it should be tracked in a separate issue
cc: @mjasikowski
mjasikowski commentedon Sep 28, 2026
Working as expected, closing