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
[Due for payment 2026-04-14] [$250] Expense - Create new report bypasses restricted action page #86579
Version Number: 9.3.50-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#85619 Email or phone of affected tester (no customers):applausetester+ap28@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 App Component: Other
Action Performed:
User has at least 2 reports with Per diem expenses in a workspace chat
User has at least 2 workspaces with per diem enabled
User has at least 1 workspace with Time feature enabled
Create a Per Diem expense before applying restriction
In both IOURequestEditReport.tsx and IOURequestStepReport.tsx, the createReport function has a Per Diem early return that calls handleCreateReport() directly without checking shouldRestrictUserBillableActions().
When the expense is a Per Diem, the function returns early on the first condition (line 141/262), so the shouldRestrictUserBillableActions() check on line 152/274 is never reached. This allows Per Diem expenses to be moved to a new report even when the workspace billing grace period restriction is active.
Other flows correctly check restrictions for all expense types — e.g., selecting an existing report in IOURequestEditReportCommon.tsx:228, the FAB create flow in useCreateReportAction.tsx:128-146, and the search bulk-move in SearchTransactionsChangeReport.tsx:140.
What changes do you think we should make in order to solve the problem?
Add the shouldRestrictUserBillableActions check before the Per Diem early return in both files:
IOURequestEditReport.tsx — In the createReport function, add the billing restriction check before the hasPerDiemTransactions early return. Use selectedReport?.policyID as the policy ID (since that's the policy the Per Diem expense belongs to, matching how createReportForPolicy uses selectedReportPolicy for Per Diem at line 122).
IOURequestStepReport.tsx — Same change: add the billing restriction check before the isPerDiemTransaction early return. Use perDiemOriginalPolicy?.id as the policy ID (since that's the Per Diem's originating policy, matching how createReportForPolicy uses it at line 249).
What alternative solutions did you explore? (Optional)
An alternative would be to move the restriction check into IOURequestEditReportCommon's handleCreateReport callback so it's applied universally before any createReport call. However, that would change the existing flow for non-Per-Diem expenses and is a larger refactor. The minimal fix of adding the check to the Per Diem early-return paths mirrors the existing pattern and is less risky.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-]Expense - Create new report bypasses restricted action page[/-][+][$250] Expense - Create new report bypasses restricted action page[/+]on Mar 27, 2026
Please re-state the problem that we are trying to solve in this issue.
When a user with an expired billing grace period clicks "Move expense" → "New report" on a Per Diem expense, a new report is created instead of showing the restricted action page.
What is the root cause of that problem?
The real gap is in handleCreateReport inside the shared component IOURequestEditReportCommon.tsx. This is the onPress handler for the "Create report" MenuItem rendered at line 256. It validates Per Diem compatibility but never checks shouldRestrictUserBillableActions. Compare with its sibling handleSelectReport at line 228 which does check restrictions before allowing an existing report to be selected. Both the IOURequestEditReport and IOURequestStepReport pages delegate to this shared component, so fixing it here covers every caller in one place.
What changes do you think we should make in order to solve the problem?
Add the shouldRestrictUserBillableActions guard to handleCreateReport in IOURequestEditReportCommon.tsx, mirroring what handleSelectReport already does. The component already imports the function (line 21) and subscribes to the required Onyx keys (lines 74–75), so the fix is just adding the check:
This single-file fix is safe because it's the same guard already used two functions above in handleSelectReport, using the same Onyx data already subscribed to, and the server validates billing status on the backend anyway.
Please re-state the problem that we are trying to solve in this issue.
When a user moves an existing Per Diem expense and selects New report, billing restriction is not enforced in this flow.
Expected result: user is redirected to the restricted action page when billable actions are restricted.
Actual result: a new report is created instead of navigating to the restricted action page.
What is the root cause of that problem?
In IOURequestStepReport, createReport() returns early for Per Diem transactions by calling handleCreateReport() before checking shouldRestrictUserBillableActions().
The restriction check only runs in the non-Per-Diem branch, so Per Diem can bypass the restricted-action gate.
Please re-state the problem that we are trying to solve in this issue.
When a user with an active billing restriction clicks "Move expense" -> "New report" on a Per Diem expense, a new report is created instead of redirecting to the restricted action page.
What is the root cause of that problem?
The root cause is in handleCreateReport inside the shared component IOURequestEditReportCommon.tsx (lines 240-245). This is the onPress handler for the "Create report" MenuItem. It validates Per Diem compatibility via validatePerDiemMove but never checks shouldRestrictUserBillableActions.
Compare with its sibling handleSelectReport at line 228 of the same file, which correctly checks restrictions before allowing an existing report to be selected. Both IOURequestEditReport and IOURequestStepReport delegate to this shared component by passing a createReport prop, so fixing it here covers all callers in one place.
The component already imports shouldRestrictUserBillableActions (line 21) and subscribes to the required Onyx keys ownerBillingGraceEndPeriod (line 75) and userBillingGraceEndPeriods (line 74), so no new dependencies are needed.
What changes do you think we should make in order to solve the problem?
Add the shouldRestrictUserBillableActions guard to handleCreateReport in IOURequestEditReportCommon.tsx, mirroring what handleSelectReport already does:
Note on existing proposals: trasnake87 proposed the same file but used incorrect argument order for shouldRestrictUserBillableActions. The correct order (matching all other call sites in the codebase) is (policyID, ownerBillingGraceEndPeriod, userBillingGraceEndPeriods).
This single-file fix is minimal and safe because it uses the same guard and the same Onyx data already present in the component, and it makes handleCreateReport and handleSelectReport consistent with each other.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.52-9 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
MelvinBot commentedon Mar 27, 2026
Proposal
What is the root cause of that problem?
In both
IOURequestEditReport.tsxandIOURequestStepReport.tsx, thecreateReportfunction has a Per Diem early return that callshandleCreateReport()directly without checkingshouldRestrictUserBillableActions().In
IOURequestEditReport.tsx:140-157:The identical pattern exists in
IOURequestStepReport.tsx:261-279withisPerDiemTransactioninstead ofhasPerDiemTransactions.When the expense is a Per Diem, the function returns early on the first condition (line 141/262), so the
shouldRestrictUserBillableActions()check on line 152/274 is never reached. This allows Per Diem expenses to be moved to a new report even when the workspace billing grace period restriction is active.Other flows correctly check restrictions for all expense types — e.g., selecting an existing report in
IOURequestEditReportCommon.tsx:228, the FAB create flow inuseCreateReportAction.tsx:128-146, and the search bulk-move inSearchTransactionsChangeReport.tsx:140.What changes do you think we should make in order to solve the problem?
Add the
shouldRestrictUserBillableActionscheck before the Per Diem early return in both files:IOURequestEditReport.tsx— In thecreateReportfunction, add the billing restriction check before thehasPerDiemTransactionsearly return. UseselectedReport?.policyIDas the policy ID (since that's the policy the Per Diem expense belongs to, matching howcreateReportForPolicyusesselectedReportPolicyfor Per Diem at line 122).IOURequestStepReport.tsx— Same change: add the billing restriction check before theisPerDiemTransactionearly return. UseperDiemOriginalPolicy?.idas the policy ID (since that's the Per Diem's originating policy, matching howcreateReportForPolicyuses it at line 249).What alternative solutions did you explore? (Optional)
An alternative would be to move the restriction check into
IOURequestEditReportCommon'shandleCreateReportcallback so it's applied universally before anycreateReportcall. However, that would change the existing flow for non-Per-Diem expenses and is a larger refactor. The minimal fix of adding the check to the Per Diem early-return paths mirrors the existing pattern and is less risky.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.melvin-bot commentedon Mar 27, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (
External)[-]Expense - Create new report bypasses restricted action page[/-][+][$250] Expense - Create new report bypasses restricted action page[/+]melvin-bot commentedon Mar 27, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022037613276148698186
trasnake87 commentedon Mar 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user with an expired billing grace period clicks "Move expense" → "New report" on a Per Diem expense, a new report is created instead of showing the restricted action page.
What is the root cause of that problem?
The real gap is in
handleCreateReportinside the shared componentIOURequestEditReportCommon.tsx. This is theonPresshandler for the "Create report"MenuItemrendered at line 256. It validates Per Diem compatibility but never checksshouldRestrictUserBillableActions. Compare with its siblinghandleSelectReportat line 228 which does check restrictions before allowing an existing report to be selected. Both theIOURequestEditReportandIOURequestStepReportpages delegate to this shared component, so fixing it here covers every caller in one place.What changes do you think we should make in order to solve the problem?
Add the
shouldRestrictUserBillableActionsguard tohandleCreateReportinIOURequestEditReportCommon.tsx, mirroring whathandleSelectReportalready does. The component already imports the function (line 21) and subscribes to the required Onyx keys (lines 74–75), so the fix is just adding the check:This single-file fix is safe because it's the same guard already used two functions above in
handleSelectReport, using the same Onyx data already subscribed to, and the server validates billing status on the backend anyway.trasnake87 commentedon Mar 27, 2026
Contributor details
Your Expensify account email: trasnake87@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~010f770315ab181656
melvin-bot commentedon Mar 27, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
abbasifaizan70 commentedon Mar 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user moves an existing Per Diem expense and selects New report, billing restriction is not enforced in this flow.
Expected result: user is redirected to the restricted action page when billable actions are restricted.
Actual result: a new report is created instead of navigating to the restricted action page.
What is the root cause of that problem?
In
IOURequestStepReport,createReport()returns early for Per Diem transactions by callinghandleCreateReport()before checkingshouldRestrictUserBillableActions().The restriction check only runs in the non-Per-Diem branch, so Per Diem can bypass the restricted-action gate.
App/src/pages/iou/request/step/IOURequestStepReport.tsx
Lines 261 to 279 in 2eaa12f
What changes do you think we should make in order to solve the problem?
App/src/pages/iou/request/step/IOURequestStepReport.tsx
Lines 261 to 279 in 2eaa12f
mgrom commentedon Mar 28, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user with an active billing restriction clicks "Move expense" -> "New report" on a Per Diem expense, a new report is created instead of redirecting to the restricted action page.
What is the root cause of that problem?
The root cause is in
handleCreateReportinside the shared componentIOURequestEditReportCommon.tsx(lines 240-245). This is theonPresshandler for the "Create report"MenuItem. It validates Per Diem compatibility viavalidatePerDiemMovebut never checksshouldRestrictUserBillableActions.Compare with its sibling
handleSelectReportat line 228 of the same file, which correctly checks restrictions before allowing an existing report to be selected. BothIOURequestEditReportandIOURequestStepReportdelegate to this shared component by passing acreateReportprop, so fixing it here covers all callers in one place.The component already imports
shouldRestrictUserBillableActions(line 21) and subscribes to the required Onyx keysownerBillingGraceEndPeriod(line 75) anduserBillingGraceEndPeriods(line 74), so no new dependencies are needed.What changes do you think we should make in order to solve the problem?
Add the
shouldRestrictUserBillableActionsguard tohandleCreateReportinIOURequestEditReportCommon.tsx, mirroring whathandleSelectReportalready does:Note on existing proposals:
trasnake87proposed the same file but used incorrect argument order forshouldRestrictUserBillableActions. The correct order (matching all other call sites in the codebase) is(policyID, ownerBillingGraceEndPeriod, userBillingGraceEndPeriods).This single-file fix is minimal and safe because it uses the same guard and the same Onyx data already present in the component, and it makes
handleCreateReportandhandleSelectReportconsistent with each other.Contributor details
Your Expensify account email: marcin.grom@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~018534923336544eae
12 remaining items
[-][$250] Expense - Create new report bypasses restricted action page[/-][+][Due for payment 2026-04-14] [$250] Expense - Create new report bypasses restricted action page[/+]melvin-bot commentedon Apr 7, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 7, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.52-9 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-04-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 7, 2026
@dukenv0307 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]
melvin-bot commentedon Apr 7, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)dukenv0307 commentedon Apr 7, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: https://github.com/Expensify/App/pull/76159/changes#r3042579627
Link to the comment on the Issue:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/624504
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-e4af-a81c-0dcb-70f3eeb3a784melvin-bot commentedon Apr 14, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Apr 15, 2026
Payment Summary
Contributor+: @dukenv0307 due $250 via NewDot
^ Test case created
@dukenv0307 please remove
<details>tags, makes it easier for me to see/find. Thxquinthar commentedon Apr 21, 2026
Approved $250 to @dukenv0307