Repository navigation
Description
Problem
The "Create report" workspace selector does not follow the intended product logic. While testing ReportActionAvatars — WorkspaceAvatar + policyID migration it became clear that nobody could reproduce the documented test steps, and digging into the code turned up three real gaps between the intended behaviour and what ships today.
The intended behaviour was spelled out by trjExpensify in this comment:
- If your default workspace is set to the personal workspace (i.e. via Classic or having no group workspaces):
- If you are a member of no group workspaces, prompt to upgrade.
- If you are a member of one group type workspace, create the report on that. (We largely ignore the personal workspace in NewDot)
- If you are a member of more than one group type workspace, show the workspace selector first to choose which one to create the report on.
- Your default group workspace is billing restricted, but not domain restricted:
- If you are a member of one group workspace, show the billing restriction modal.
- If you are a member of more than one group workspace, show the workspace selector first.
- If you pick a billing restricted workspace, show the billing restriction modal.
- If you pick a non-billing restricted workspace, allow creating the report on that.
- Your default group workspace is domain restricted, but not billing restricted:
- Don't show the selector, regardless of how many workspaces you are a member of.
- Your default group workspace is billing restricted and domain restricted:
- Don't show the selector, regardless of how many workspaces you are a member of.
- Show the billing restriction modal.
The first two bullets match the code. The remaining three do not.
What's wrong
1. Domain restrictions are ignored entirely.
src/hooks/useCreateReport.tsx:111-129 branches only on "is the default personal" and "is the default billing restricted". It never looks at the domain securityGroup's preferred-workspace restriction. A domain-restricted user gets the same behaviour as an unrestricted one: the selector still opens in the same situations. src/pages/DynamicNewReportWorkspaceSelectionPage.tsx:236 then lists every eligible workspace they belong to, with no preferred-workspace filtering.
2. Billing + domain restricted shows the selector instead of the billing modal.
Same branch at useCreateReport.tsx:122: when the default is billing restricted and the user belongs to more than one workspace, the selector wins. ROUTES.RESTRICTED_ACTION is only reached at useCreateReport.tsx:141, which requires exactly one eligible workspace.
3. FAB shows the selector when the default is the 3rd+ eligible workspace.
src/pages/inbox/sidebar/FABPopoverContent/menuItems/CreateReportMenuItem.tsx:34-36 truncates the eligible-policy list with .slice(0, 2). If the default workspace isn't in that first slice, getDefaultChatEnabledPolicy can't find it, returns undefined, and the !workspaceIDForReportCreation guard opens the selector instead of creating the report directly on the default.
This is FAB-only. The Search router (useCreateNavigationSuggestions.ts:111) and the Reports empty view (EmptySearchView.tsx:90) pass the unsliced list and behave correctly. It's also what made the original PR's test steps unreproducible — m-natarajan confirmed the selector appeared only when the default was the 3rd workspace in the list.
Expected
Align all three with the spec above:
- Respect the domain securityGroup preferred-workspace restriction — skip the selector for domain-restricted users regardless of workspace count.
- When the default is both billing and domain restricted, show the billing restriction modal instead of the selector.
- Drop the
.slice(0, 2)truncation on the FAB (or resolve the default before truncating) so a default that happens to be 3rd+ in the list creates the report directly.
Actual
- Domain restrictions have no effect on the flow.
- Billing + domain restricted users with 2+ workspaces get the selector.
- FAB opens the selector when the default is the 3rd+ eligible workspace.
Follow-up to ReportActionAvatars — WorkspaceAvatar + policyID migration, specifically this comment. That PR was a pure avatar refactor and did not change any of this flow.
Activity
jponikarchuk commentedon Sep 24, 2026
Deploy Blocker #102130 was identified to be related to the PR #101430 that attempted to fix this issue.
melvin-bot commentedon Sep 24, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
[-]Create report workspace selector ignores domain restrictions and misfires on the FAB[/-][+][Due for payment 2026-10-01] Create report workspace selector ignores domain restrictions and misfires on the FAB[/+]melvin-bot commentedon Sep 24, 2026
@sobitneupane
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.92-8 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 2026-10-01. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]
54 remaining items
sobitneupane commentedon Oct 30, 2026
You are right. I only reviewed the PR that was reverted. so, I guess no payment.
trjExpensify commentedon Oct 30, 2026
@jmusial IIRC from Classic, we allow moving expenses and reports to other workspaces with this setting enabled. So I think those are intentional.
jmusial commentedon Nov 2, 2026
@trjExpensify makes sense, thanks. Then let's drop 3.
That leaves
trjExpensify commentedon Nov 2, 2026
@mountiny @rayane-d would be good people to look into this.
Feel free to spin out a new issue for it. 👍
huult commentedon Nov 3, 2026
@MelvinBot Please create a new issue for item 4 (consolidating the default-workspace rule across the ~20 affected flows) and assign it to me, @jmusial. Thanks!
MelvinBot commentedon Nov 3, 2026
I created Consolidate the default-workspace eligibility rule across report and expense flows for item 4. It has the
TaskandWeeklylabels.I assigned both
jmusialandhuult, because "assign it to me, @jmusial" could mean either person. Remove whichever assignee you don't need.The issue lists the three checks that disagree (
canCreateReportOnPolicy, the check insideuseDefaultExpensePolicy, andisPolicyValidForMovingExpenses), with permalinks. I found no existing issue that covers this work.huult commentedon Nov 3, 2026
@MelvinBot Could you please create a Backend issue for items 1 and 2 and assign it to @mountiny and @rayane-d? Thanks!
MelvinBot commentedon Nov 3, 2026
I created an internal issue for backend items 1 and 2 and assigned it to
mountinyandrayane-d. It covers:activePolicyID) as soon as the admin sets or changes it, or a member joins the group.The issue is in a private repo, so I can't link it here.
mountinyandrayane-dcan find it in their assigned issues. I found no existing issue covering this work.huult commentedon Nov 3, 2026
Alright, I've created two separate tickets for Backend and App so the teams can continue working on them. This ticket is now resolved, so I'll close it. cc @trjExpensify
JmillsExpensify commentedon Nov 14, 2026
$175 approved for @huult