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
Expense - Error shows up after creating expense to approve-only workspace from self DM #104945
Version Number: 9.5.20-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:#102933 Email or phone of affected tester (no customers):jowienwonjsdj3@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Money Requests
Action Performed:
Precondition:
User B has a workspace and make it default workspace.
User A creates a Control workspace.
User A invites User B to workspace with approve-only role.
Perform the steps below as User B:
Go to staging.new.expensify.com
Delete the default workspace.
Go to self DM.
Create an expense.
Click Submit to my employer.
Enter merchant and click Create expense.
Expected Result:
Approve-only member should not be able to create expense in the workspace chat via Submit to my employer flow.
Actual Result:
Approve-only member is able to create expense in the workspace chat via Submit to my employer flow.
Error shows up in the self DM after creating expense via Submit to my employer flow.
👋 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.
Root cause: The "Submit to my employer" flow counts workspaces with createFilteredPoliciesInfoSelector. That selector never checks canCreateExpensesOnPolicy. After the user deletes their default workspace, the approve-only workspace is the only one counted. The single-workspace shortcut in StartExpenseFlows.ts:409-426 then skips the picker and submits straight to that workspace. The backend correctly rejects the request, and the error appears in the self DM.
Recommended fix (App only, fix forward): In src/selectors/Policy.ts:427, also skip policies where canCreateExpensesOnPolicy(policy, email) is false. With only an approve-only workspace, the count becomes 0 and the flow uses the existing "create a new Submit workspace" path. Add a unit test for that case. If a fix can't land quickly, revert #102933.
Investigation details
Why this PR: It introduced the approve-only role and added the create-expense check to the workspace picker (ParticipantSearchResults → OptionsListUtils), but not to this selector. With two or more workspaces the picker is shown and correctly hides the approve-only workspace, so the bug only appears when that workspace is the only one counted, which is what step 2 of the repro sets up. No other PR on the current checklist changes this selector or the employer branch.
Optional:getActivePoliciesWithExpenseChat (src/libs/PolicyUtils/policy.ts) and createHasWorkspaceToSubmitToSelector (src/selectors/Policy.ts) also lack the check. They control whether Submit options appear for split expenses.
Why the error lands in the self DM:submitTrackedExpenseToPolicy sends AddTrackedExpenseToPolicy and shows the expense optimistically in the workspace chat. When the backend rejects it, the failure data puts iou.error.genericCreateFailureMessage on the tracked-expense action in the self DM.
Why not revert first: The fix is a one-line condition. Reverting a ~50-file feature that ships with a backend change carries more risk. No bad data is written, because the backend blocks the request.
Next Steps:ShridharGoel (PR author) can fix forward with the change above. Reply with @MelvinBot <your feedback> to refine this analysis.
Activity
melvin-bot commentedon Oct 26, 2026
@flodnv recently merged #102933, but they are OOO right now, so I'll auto-assign someone else.
applause-bot commentedon Oct 26, 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/e132500d9b0d67a8f9cfb86cf0f14cf0b7c82d2ebce30624e845b1fa030a8927
melvin-bot commentedon Oct 26, 2026
Triggered auto assignment to @inimaga (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Oct 26, 2026
@flodnv @Pujan92 you have been assigned to this deploy blocker because you reviewed the offending PR: #102933
github-actions commentedon Oct 26, 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 Oct 26, 2026
@ShridharGoel you have been assigned to this deploy blocker because you authored the offending PR: #102933
melvin-bot commentedon Oct 26, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Oct 26, 2026
Deploy Blocker Analysis
Causing PR (high confidence): [Payment due @Pujan92] Add approve-only workspace role (
Expensify/App#102933)Root cause: The "Submit to my employer" flow counts workspaces with
createFilteredPoliciesInfoSelector. That selector never checkscanCreateExpensesOnPolicy. After the user deletes their default workspace, the approve-only workspace is the only one counted. The single-workspace shortcut inStartExpenseFlows.ts:409-426then skips the picker and submits straight to that workspace. The backend correctly rejects the request, and the error appears in the self DM.Recommended fix (App only, fix forward): In
src/selectors/Policy.ts:427, also skip policies wherecanCreateExpensesOnPolicy(policy, email)is false. With only an approve-only workspace, the count becomes 0 and the flow uses the existing "create a new Submit workspace" path. Add a unit test for that case. If a fix can't land quickly, revert #102933.Investigation details
ParticipantSearchResults→OptionsListUtils), but not to this selector. With two or more workspaces the picker is shown and correctly hides the approve-only workspace, so the bug only appears when that workspace is the only one counted, which is what step 2 of the repro sets up. No other PR on the current checklist changes this selector or the employer branch.ReportDetailsMenuTrackExpenseItems.tsx:65andMoneyRequestHeaderSecondaryActions.tsx:198, besidesChatActionableButtons.tsx:200. One selector fix covers all three.getActivePoliciesWithExpenseChat(src/libs/PolicyUtils/policy.ts) andcreateHasWorkspaceToSubmitToSelector(src/selectors/Policy.ts) also lack the check. They control whether Submit options appear for split expenses.submitTrackedExpenseToPolicysendsAddTrackedExpenseToPolicyand shows the expense optimistically in the workspace chat. When the backend rejects it, the failure data putsiou.error.genericCreateFailureMessageon the tracked-expense action in the self DM.Next Steps:
ShridharGoel(PR author) can fix forward with the change above. Reply with@MelvinBot <your feedback>to refine this analysis.view run
m-natarajan commentedon Oct 26, 2026
Not Reproducible
Unable to reproduce - Approve-only no longer available
iPhone 14 / iOS 26.6.2
Version 9.5.20-4
IMG_0009.2.MP4
melvin-bot commentedon Oct 29, 2026
@ShridharGoel Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!