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 - Actual workspace is not checked during "Change Workspace" process. #106600
Version Number: 9.5.36-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:#104295 Email or phone of affected tester (no customers):ibellicotest+3215@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome App Component: Search
Action Performed:
Prerequisite: Account has at least two workspaces.
Prerequisite 2: At least one report created in one workspace chat.
Open the staging.new.expensify.com website.
Navigate to "Spend" > "Reports"
Select a report > "Change Workspace"
When RHP with workspaces list opens, note that actual workspace is not checked.
Expected Result:
The actual workspace where report was created, should be displayed checked during the "Change Workspace" process.
Actual Result:
The actual workspace where report was created, is not displayed checked during the "Change Workspace" process.
👋 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.
SearchChangeWorkspacePage.tsx:96–106 supplies only that draft destination to the workspace list, without falling back to the report’s current workspace.
The PR introduces this page and its faulty initialization; attribution is supported by its diff, not just the automated assignments.
Scope caveat: This explains the Search selected-report action. The existing report-detail picker already falls back to the report’s current workspace. If the recording shows that separate route, further investigation is needed.
What changes do you think we should make in order to solve the problem?
Initialize the checked workspace from the explicitly selected report’s current workspace, while allowing a newly chosen destination to override it.
Keep Save disabled until the destination actually changes.
Do not preselect an arbitrary workspace for mixed-workspace selections.
Do not infer the workspace of all matching reports from only loaded results.
Fix the Search page, not the shared workspace-list hook.
Verify that opening the picker checks the current workspace, choosing another workspace updates the check and enables Save, and reopening after saving checks the new workspace. Cover mixed-workspace and unloaded “Select all” cases.
What alternative solutions did you explore?
Reverting the feature would remove the affected flow, but a focused fix is more proportionate for this defect alone.
Verification limitation: Code investigation completed; browser reproduction and fix verification were not performed. No code changes were made.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/106600) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
This is the only blocker so far that directly relates to the PR and wasn't discussed during the PR review.
That said, I wouldn't even call it a bug or a regression:
It was never discussed, and it was implemented this way from the very beginning: there is no single selected item, since the selected reports can be from different workspaces.
If all the reports are from the same workspace, the Save button is disabled when that workspace is selected.
Please re-state the problem that we are trying to solve in this issue.
When a user selects a report (or multiple reports belonging to the same workspace) on Spend > Reports and opens Change Workspace (SearchChangeWorkspacePage), the workspace list RHP opens with no workspace checked, whereas opening Change Workspace from a report (DynamicReportChangeWorkspacePage) checks and pins the report's current workspace while keeping Save disabled until a different workspace is chosen.
const[policyID,setPolicyID]=useState<string>();
...
const{data, shouldShowNoResultsFoundMessage, shouldShowSearchInput}=useWorkspaceList({
policies,currentUserLogin: session?.email,shouldShowPendingDeletePolicy: false,selectedPolicyIDs: policyID ? [policyID] : undefined,// An empty list keeps the picked workspace where it is instead of moving it to the top.policyIDsToSortToTop: [],searchTerm: debouncedSearchTerm,
localeCompare,additionalFilter: canMoveAReportTo,});
policyID starts as undefined with no fallback to the current workspace of the selected report(s), so selectedPolicyIDs is undefined on initial render and useWorkspaceList marks every row isSelected: false.
Interestingly, the Save button's isDisabled check at line 180 already accounts for the case where all selected reports share a single policyID:
However, notice also that selectedReports[i].policyID comes from the Search selection state, while if a report was already moved once in the same session, the live Onyx report (selectedOnyxReports['report_' + reportID].policyID) via movableReports (lines 67–82) holds the up-to-date policyID!
What changes do you think we should make in order to solve the problem?
Align SearchChangeWorkspacePage.tsx with DynamicReportChangeWorkspacePage.tsx (src/pages/DynamicReportChangeWorkspacePage.tsx, lines 132–135 & 246–250) when all explicitly selected movable reports share a single current workspace (!areAllMatchingItemsSelected):
Derive commonCurrentPolicyID from the selected reports (preferring live Onyx report policyID via movableReports):
When a single report (or multiple reports from the same workspace) is selected, its current workspace is checked and pinned to the top on open, with Save disabled until a different workspace is selected.
If a report is moved to Workspace B and Change Workspace is opened again, movableReports reads the live selectedOnyxReportspolicyID, so Workspace B is checked immediately.
When reports from multiple different workspaces are selected (uniqueCurrentPolicyIDs.length > 1) or "Select all" across pages (areAllMatchingItemsSelected) is active, commonCurrentPolicyID is undefined, so no workspace is pre-checked.
What alternative approaches did you explore? (Optional)
Checking selectedReports.every((report) => report.policyID === ...) directly on selectedReports was considered, but reading report.policyID from movableReports (which merges selectedOnyxReports via getReportFromSearchSnapshot) is strictly better because selectedReports in SearchSelectionContext is seeded from the Search snapshot, whereas selectedOnyxReports reflects live workspace moves immediately.
Activity
applause-bot commentedon Nov 11, 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/f54e1581bbc874762d20cefe72915fc9db1dc4b801dded51170565e13eef76e8
melvin-bot commentedon Nov 11, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #104295
melvin-bot commentedon Nov 11, 2026
@JS00001 @mollfpr @Eskalifer1 you have been assigned to this deploy blocker because you reviewed the offending PR: #104295
melvin-bot commentedon Nov 11, 2026
@allgandalf you have been assigned to this deploy blocker because you authored the offending PR: #104295
melvin-bot commentedon Nov 11, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Nov 11, 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:
MelvinBot commentedon Nov 11, 2026
Proposal
Recommendation: roll forward with a focused fix. Keep the deploy blocker until verification passes.
What is the root cause of that problem?
Add Change workspace to Search bulk actions introduced a workspace picker that starts without a selected workspace instead of using the report’s current workspace.
Code evidence and attribution
SearchChangeWorkspacePage.tsx:49–62initializes the destinationpolicyIDas undefined.SearchChangeWorkspacePage.tsx:96–106supplies only that draft destination to the workspace list, without falling back to the report’s current workspace.useWorkspaceList.ts:57–73consequently marks every workspace unselected.The PR introduces this page and its faulty initialization; attribution is supported by its diff, not just the automated assignments.
Scope caveat: This explains the Search selected-report action. The existing report-detail picker already falls back to the report’s current workspace. If the recording shows that separate route, further investigation is needed.
What changes do you think we should make in order to solve the problem?
Initialize the checked workspace from the explicitly selected report’s current workspace, while allowing a newly chosen destination to override it.
Verify that opening the picker checks the current workspace, choosing another workspace updates the check and enables Save, and reopening after saving checks the new workspace. Cover mixed-workspace and unloaded “Select all” cases.
What alternative solutions did you explore?
Reverting the feature would remove the affected flow, but a focused fix is more proportionate for this defect alone.
Verification limitation: Code investigation completed; browser reproduction and fix verification were not performed. No code changes were made.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/106600)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
mollfpr commentedon Nov 11, 2026
This is minor, so I'm removing the blocker label. We can fix it separately.
Eskalifer1 commentedon Nov 11, 2026
This is the only blocker so far that directly relates to the PR and wasn't discussed during the PR review.
That said, I wouldn't even call it a bug or a regression:
I think this is a issue for a follow-up.
cc: @mollfpr @allgandalf
cocvn157 commentedon Nov 15, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user selects a report (or multiple reports belonging to the same workspace) on Spend > Reports and opens Change Workspace (
SearchChangeWorkspacePage), the workspace list RHP opens with no workspace checked, whereas opening Change Workspace from a report (DynamicReportChangeWorkspacePage) checks and pins the report's current workspace while keeping Save disabled until a different workspace is chosen.What is the root cause of that problem?
src/pages/Search/SearchChangeWorkspacePage.tsx:policyIDstarts asundefinedwith no fallback to the current workspace of the selected report(s), soselectedPolicyIDsisundefinedon initial render anduseWorkspaceListmarks every rowisSelected: false.isDisabledcheck at line 180 already accounts for the case where all selected reports share a singlepolicyID:selectedReports[i].policyIDcomes from the Search selection state, while if a report was already moved once in the same session, the live Onyx report (selectedOnyxReports['report_' + reportID].policyID) viamovableReports(lines 67–82) holds the up-to-datepolicyID!What changes do you think we should make in order to solve the problem?
Align
SearchChangeWorkspacePage.tsxwithDynamicReportChangeWorkspacePage.tsx(src/pages/DynamicReportChangeWorkspacePage.tsx, lines 132–135 & 246–250) when all explicitly selected movable reports share a single current workspace (!areAllMatchingItemsSelected):commonCurrentPolicyIDfrom the selected reports (preferring live Onyx reportpolicyIDviamovableReports):src/pages/Search/SearchChangeWorkspacePage.tsx:currentSelectionandinitialSelectiontouseWorkspaceListandSelectionList:selectedPolicyIDs: currentSelection ? [currentSelection] : undefinedandpolicyIDsToSortToTop: initialSelection ? [initialSelection] : []touseWorkspaceList.initiallyFocusedItemKey={initialSelection}andonSelectRow={(option) => setDraftPolicyID(option.policyID)}toSelectionList.confirmButtonOptions.isDisabledandchangeWorkspaceto usecurrentSelection:movableReportsreads the liveselectedOnyxReportspolicyID, so Workspace B is checked immediately.uniqueCurrentPolicyIDs.length > 1) or"Select all"across pages (areAllMatchingItemsSelected) is active,commonCurrentPolicyIDisundefined, so no workspace is pre-checked.What alternative approaches did you explore? (Optional)
Checking
selectedReports.every((report) => report.policyID === ...)directly onselectedReportswas considered, but readingreport.policyIDfrommovableReports(which mergesselectedOnyxReportsviagetReportFromSearchSnapshot) is strictly better becauseselectedReportsinSearchSelectionContextis seeded from the Search snapshot, whereasselectedOnyxReportsreflects live workspace moves immediately.JS00001 commentedon Nov 16, 2026
@allgandalf lets follow up on this please
Eskalifer1 commentedon Nov 16, 2026
Left comment here: #106601 (comment)