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 when approve-only member creates per diem expense #104917
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):jsnoidjosinjdiosj2@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 A creates a Control workspace and imports per diem rates to the workspace.
User B creates a workspace and imports per diem rates to the 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
Open FAB > Create expense > Per diem.
Select workspace with approve-only role.
Create a per diem expense in that workspace.
Expected Result:
In Step 3, approve-only member should not be able to choose the workspace when creating per diem expense.
Actual Result:
In Step 3, approve-only member is able to choose the workspace when creating per diem expense.
In Step 4, error shows up after creating per diem expense in the workspace.
👋 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.
Recommendation: roll forward with a one-line fix. Revert only if the fix can't land quickly. The feature isn't in production yet.
Root cause: The PR added canCreateExpensesOnPolicy and applied it to most expense flows. It missed getActivePoliciesWithExpenseChat (policy.ts:70-81). That function accepts any role, including approve-only. It feeds the per diem workspace picker, so approve-only workspaces show up in the list. The server then rejects the expense on submit, which causes the error in step 4.
Fix: Add canCreateExpensesOnPolicy(policy, currentUserLogin) && to the filter in getActivePoliciesWithExpenseChat. The import already exists at policy.ts:24. Add a unit test in tests/unit/PolicyUtilsTest.ts that excludes an approve-only workspace with per diem enabled.
selectors/Policy.ts:383-391 uses the same helper to count per diem workspaces. IOURequestStartPage uses those counts to show the Per diem tab and to auto-select a single workspace.
In permissions.ts:325, the approve-only role has no create-expense permission.
Flows the PR did update with canCreateExpensesOnPolicy
Moving expenses and reports (usePolicyForMovingExpenses, IOURequestEditReportCommon)
Report creation (canCreateReportOnPolicy at policy.ts:298)
canAddTransaction, canRequestMoney, and the attachment picker menu
Why fix at this level: The same change also fixes the time-tracking picker (getActivePoliciesWithExpenseChatAndTimeEnabled), the start-page counts, and createHasWorkspaceToSubmitToSelector. It also matches the function name, because the PR stops creating workspace chats for approve-only members.
Why not revert: The PR touches about 50 files, and the fix is small and contained.
Not verified: I didn't see the exact error text from step 4. The conclusion doesn't depend on it.
Next Steps: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
Activity
applause-bot commentedon Oct 23, 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/aef31f78cfb7445f8b56ddf2a66020966e9fa655c42181e8bff9d57eb5c082d3
melvin-bot commentedon Oct 23, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #102933
melvin-bot commentedon Oct 23, 2026
@flodnv @Pujan92 you have been assigned to this deploy blocker because you reviewed the offending PR: #102933
melvin-bot commentedon Oct 23, 2026
@ShridharGoel you have been assigned to this deploy blocker because you authored the offending PR: #102933
melvin-bot commentedon Oct 23, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Oct 23, 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 Oct 23, 2026
Deploy Blocker Investigation
Causing PR: [Payment due @Pujan92] Add approve-only workspace role (high confidence). This is a frontend bug.
Recommendation: roll forward with a one-line fix. Revert only if the fix can't land quickly. The feature isn't in production yet.
Root cause: The PR added
canCreateExpensesOnPolicyand applied it to most expense flows. It missedgetActivePoliciesWithExpenseChat(policy.ts:70-81). That function accepts any role, including approve-only. It feeds the per diem workspace picker, so approve-only workspaces show up in the list. The server then rejects the expense on submit, which causes the error in step 4.Fix: Add
canCreateExpensesOnPolicy(policy, currentUserLogin) &&to the filter ingetActivePoliciesWithExpenseChat. The import already exists at policy.ts:24. Add a unit test intests/unit/PolicyUtilsTest.tsthat excludes an approve-only workspace with per diem enabled.Investigation details
Code path
getActivePoliciesWithExpenseChatAndPerDiemEnabledis just the unfiltered helper plusisPerDiemEligiblePolicy.BaseRequestStepWorkspace, which renders the list with no extra filtering.IOURequestStartPageuses those counts to show the Per diem tab and to auto-select a single workspace.Flows the PR did update with
canCreateExpensesOnPolicyexcludeWorkspacesWithoutCreateExpensePermission)useDefaultExpensePolicy,SetDefaultWorkspacePage)usePolicyForMovingExpenses,IOURequestEditReportCommon)canCreateReportOnPolicyat policy.ts:298)canAddTransaction,canRequestMoney, and the attachment picker menuWhy fix at this level: The same change also fixes the time-tracking picker (
getActivePoliciesWithExpenseChatAndTimeEnabled), the start-page counts, andcreateHasWorkspaceToSubmitToSelector. It also matches the function name, because the PR stops creating workspace chats for approve-only members.Why not revert: The PR touches about 50 files, and the fix is small and contained.
Not verified: I didn't see the exact error text from step 4. The conclusion doesn't depend on it.
Next Steps: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.view run
m-natarajan commentedon Oct 26, 2026
Feature reverted, Not repro ("Approve-only" role option is no longer available in Workspace Settings > Members.)
Mac 26.6/ Chrome, Version: 9.5.20-5
Grabando.177.1.mp4
melvin-bot commentedon Oct 29, 2026
@ShridharGoel Whoops! This issue is 2 days overdue. Let's get this updated quick!