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
Per diem - Report from workspace with disabled per diem is not filtered out in report list #82881
Version Number: 9.3.22-1 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#81942 Email or phone of affected tester (no customers):sdiojsnidojodjnosjios@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Create two workspaces - A and B.
Workspace A has per diem rates.
Do not enable per diem in workspace B.
Go to staging.new.expensify.com
Go to workspace chat A.
Create two empty reports.
Go to workspace chat B.
Create an empty report.
Open FAB > Create expense > Per diem.
Select any data and proceed to confirm page.
On confirm page, click Report field.
Select report from workspace B.
Expected Result:
Report from workspace B should not appear in Report list because workspace B has disabled per diem feature.
Actual Result:
Report from workspace B appears in Report list when workspace B has disabled per diem feature.
👋 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.
Please re-state the problem that we are trying to solve in this issue.
When creating a per diem expense via global create (FAB), the report picker on the confirmation page shows reports from all workspaces — including those that have per diem disabled. Reports from workspaces without per diem enabled should not appear in the list.
What is the root cause of that problem?
PR #81942 changed IOURequestStepReport.tsx:265 so that for per diem transactions created via global create, selectedPolicyID is set to undefined instead of the originating policy ID:
When selectedPolicyID is undefined, useOutstandingReports (at src/hooks/useOutstandingReports.ts:24-34) iterates over all user policies and returns reports from every workspace. There is no per-diem-specific filtering anywhere in this chain — neither in useOutstandingReports nor in the reportOptions construction in IOURequestEditReportCommon.tsx.
The only per-diem check that exists is validatePerDiemMove (IOURequestEditReportCommon.tsx:189-204), but this is a reactive check — it fires after the user selects a report and shows a warning modal. It does not filter the report list itself.
What changes do you think we should make in order to solve the problem?
In IOURequestEditReportCommon.tsx, add a filter to the reportOptions useMemo (around line 124) that, when isPerDiemRequest is true, excludes reports whose policy does not have per diem enabled. The component already receives isPerDiemRequest as a prop and has access to allPolicies.
The filter should check arePerDiemRatesEnabled on each report's policy. The existing utility canSubmitPerDiemExpenseFromWorkspace from PolicyUtils.ts (line 1141) could be reused here — it already checks that the policy has expense chat enabled, a per diem custom unit exists, and the custom unit is enabled.
This way, even when selectedPolicyID is undefined (allowing cross-workspace report selection for global create, as intended by PR #81942), the list only shows reports from workspaces that actually support per diem.
What alternative solutions did you explore? (Optional)
An alternative is to add the filtering inside useOutstandingReports by passing an isPerDiemRequest parameter and skipping policies without arePerDiemRatesEnabled when iterating all policies. However, filtering in reportOptions within IOURequestEditReportCommon is more targeted and avoids changing the generic hook's interface.
Detailed Investigation
Root Cause Analysis
The data flow is:
User initiates per diem expense from global create (FAB) → transaction.isFromGlobalCreate = true
Activity
melvin-bot commentedon Feb 19, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #81942
melvin-bot commentedon Feb 19, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Feb 19, 2026
Triggered auto assignment to @bfitzexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.github-actions commentedon Feb 19, 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 Feb 19, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When creating a per diem expense via global create (FAB), the report picker on the confirmation page shows reports from all workspaces — including those that have per diem disabled. Reports from workspaces without per diem enabled should not appear in the list.
What is the root cause of that problem?
PR #81942 changed
IOURequestStepReport.tsx:265so that for per diem transactions created via global create,selectedPolicyIDis set toundefinedinstead of the originating policy ID:When
selectedPolicyIDisundefined,useOutstandingReports(atsrc/hooks/useOutstandingReports.ts:24-34) iterates over all user policies and returns reports from every workspace. There is no per-diem-specific filtering anywhere in this chain — neither inuseOutstandingReportsnor in thereportOptionsconstruction inIOURequestEditReportCommon.tsx.The only per-diem check that exists is
validatePerDiemMove(IOURequestEditReportCommon.tsx:189-204), but this is a reactive check — it fires after the user selects a report and shows a warning modal. It does not filter the report list itself.What changes do you think we should make in order to solve the problem?
In
IOURequestEditReportCommon.tsx, add a filter to thereportOptionsuseMemo (around line 124) that, whenisPerDiemRequestis true, excludes reports whose policy does not have per diem enabled. The component already receivesisPerDiemRequestas a prop and has access toallPolicies.The filter should check
arePerDiemRatesEnabledon each report's policy. The existing utilitycanSubmitPerDiemExpenseFromWorkspacefromPolicyUtils.ts(line 1141) could be reused here — it already checks that the policy has expense chat enabled, a per diem custom unit exists, and the custom unit is enabled.This way, even when
selectedPolicyIDisundefined(allowing cross-workspace report selection for global create, as intended by PR #81942), the list only shows reports from workspaces that actually support per diem.What alternative solutions did you explore? (Optional)
An alternative is to add the filtering inside
useOutstandingReportsby passing anisPerDiemRequestparameter and skipping policies withoutarePerDiemRatesEnabledwhen iterating all policies. However, filtering inreportOptionswithinIOURequestEditReportCommonis more targeted and avoids changing the generic hook's interface.Detailed Investigation
Root Cause Analysis
The data flow is:
transaction.isFromGlobalCreate = trueIOURequestStepReport.tsx:265setsselectedPolicyID = undefined(changed by PR fix: report from the other workspace doesn't appear in the report field #81942)useOutstandingReports.ts:24-34— whenselectedPolicyIDisundefined, iterates ALL user policies and aggregates reports from every workspaceIOURequestEditReportCommon.tsx:119-153—reportOptionsfilters only for search text andcanAddTransaction, with no per-diem checkEvidence Chain
IOURequestStepReport.tsx:265:selectedPolicyID = isFromGlobalCreate ? undefined : perDiemOriginalPolicy?.id— the one-line change from PR fix: report from the other workspace doesn't appear in the report field #81942useOutstandingReports.ts:24-34: loops all policies whenselectedPolicyIDis undefined, no per-diem checkIOURequestEditReportCommon.tsx:119-153:reportOptionshas noarePerDiemRatesEnabledfilterIOURequestEditReportCommon.tsx:189-204:validatePerDiemMoveis post-selection only (shows modal), not a list filterPolicyUtils.ts:118-120:getActivePoliciesWithExpenseChatAndPerDiemEnabledexists but is only used inIOURequestStartPage, not the report pickerPolicyUtils.ts:1141-1144:canSubmitPerDiemExpenseFromWorkspaceexists but is only used inusePolicyForMovingExpenses, not the report pickerRelevant Code
src/pages/iou/request/step/IOURequestStepReport.tsx:263-268— selectedPolicyID computationsrc/hooks/useOutstandingReports.ts:24-37— report aggregation logicsrc/pages/iou/request/step/IOURequestEditReportCommon.tsx:119-153— reportOptions filtering (missing per-diem filter)src/pages/iou/request/step/IOURequestEditReportCommon.tsx:159-204— per-diem validation (post-selection only)src/libs/PolicyUtils.ts:1141-1144—canSubmitPerDiemExpenseFromWorkspace(reusable utility)Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.izarutskaya commentedon Feb 19, 2026
Issue is not reproducible
Build 9.3.22-2
Windows 11 / Chrome
Screen.Recording.2026-02-19.at.14.20.34.mp4
Recording.3647.mp4
Not Repro on iPhone 12/iOS 26.3/App/Build v9.3.22-2
ee.mp4
Not Repro on Samsung Galaxy A40/Android 11/App/Build v9.3.22-2
mobizen_20260219_150336.mp4
MarioExpensify commentedon Feb 19, 2026
Thank you @izarutskaya. Closing this one - will be fixed in the original issue.