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
[$250] Reports - Reports are submitted and approved without restricted action page #84030
Version Number: 9.3.28-1 Reproducible in staging?: Yes Reproducible in production?: Unable to validate in Prod - Provide reasoning. If this was caught during regression testing, add the test name, ID and link from BrowserStack:#83149 Email or phone of affected tester (no customers):applausetester+kdpdpdpd@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Mac 26.2 / Chrome App Component: Search
Action Performed:
Precondition:
Have separate reports pending submission, approval and payment.
Run Onyx.merge('sharedNVP_private_billingGracePeriodEnd_[replaceWithYourACcountID]', {value: 1}); in console.
Go to staging.new.expensify.com
Go to Reports > Expenses.
Click Submit.
Click Approve.
Click Pay > Mark as paid.
Expected Result:
Restricted action page will open when submitting and approving reports from Reports.
Actual Result:
Reports are submitted and approved without restricted action page on Reports.
🚨 Edited by proposal-police: This proposal was edited at 2026-03-03 13:18:41 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Reports - Reports are submitted and approved without restricted action page
What is the root cause of that problem?
When submitting or approving reports from the Reports page, handleActionButtonPress calls submitMoneyRequestOnSearch and approveMoneyRequestOnSearch directly without checking for billing grace period restrictions. These functions call the API directly, bypassing the restriction checks in submitReport and approveMoneyRequest.
The Pay action already has the restriction check in getPayActionCallback via handleBulkPayItemSelected, which is why only Pay shows the restricted action page.
constselectedPolicyIDList=itemList.map((item)=>item.policyID).filter((policyID): policyID is string=>!!policyID);constrestrictedPolicyID=selectedPolicyIDList.find((policyID)=>shouldRestrictUserBillableActions(policyID));if(restrictedPolicyID){Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(restrictedPolicyID));return;}
Please re-state the problem that we are trying to solve in this issue.
When a user has an active billing grace period (sharedNVP_private_billingGracePeriodEnd set), submitting and approving reports from the Reports > Expenses (Search) view proceeds normally instead of showing the Restricted Action page. The Restricted Action page correctly appears when submitting/approving from the direct report view (e.g., via the report header), but the Search bulk actions bypass this check entirely.
What is the root cause of that problem?
The Search bulk actions for Submit and Approve use completely separate code paths from the normal report view actions, and these paths never call shouldRestrictUserBillableActions to check the billing grace period:
Submit (src/hooks/useSearchBulkActions.ts:796-818): The onSelected handler directly calls submitMoneyRequestOnSearch() (src/libs/actions/Search.ts:530) without any billing restriction check.
Approve (src/hooks/useSearchBulkActions.ts:347-394): handleApproveWithDEWCheck() checks for delegate access and DEW policies, but never calls shouldRestrictUserBillableActions. It then calls approveMoneyRequestOnSearch() (src/libs/actions/Search.ts:585) which also has no check.
In contrast, the normal report view actions go through submitReport() (src/libs/actions/IOU/index.ts:11477) and approveMoneyRequest() (src/libs/actions/IOU/index.ts:10596), which both check shouldRestrictUserBillableActions and navigate to ROUTES.RESTRICTED_ACTION when the billing grace period is active.
Note: The Pay sub-item selection path (handleBulkPayItemSelected at src/libs/actions/Search.ts:1348) does have the billing check, but the onBulkPaySelected path (src/hooks/useSearchBulkActions.ts:509) does not.
What changes do you think we should make in order to solve the problem?
Add shouldRestrictUserBillableActions checks to the Search bulk actions flow in src/hooks/useSearchBulkActions.ts:
Pass userBillingGraceEndPeriods (already loaded via useOnyx in SearchBulkActionsButton.tsx:46) into the useSearchBulkActions hook as a parameter.
Add the billing restriction check in the SubmitonSelected handler (around line 802) — before calling submitMoneyRequestOnSearch(), iterate through the selected items' policies and check shouldRestrictUserBillableActions. If any policy is restricted, navigate to ROUTES.RESTRICTED_ACTION and return early instead of submitting.
Add the same check in handleApproveWithDEWCheck (around line 347) — before calling approveMoneyRequestOnSearch().
Add the same check in onBulkPaySelected (around line 509) — before calling payMoneyRequestOnSearch().
This matches the pattern already used in handleBulkPayItemSelected at src/libs/actions/Search.ts:1348-1351.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
changed the title [-]Reports - Reports are submitted and approved without restricted action page[/-][+][$250] Reports - Reports are submitted and approved without restricted action page[/+]on Mar 3, 2026
Activity
melvin-bot commentedon Mar 3, 2026
Triggered auto assignment to @jliexpensify (
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.nyomanjyotisa commentedon Mar 3, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-03-03 13:18:41 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Reports - Reports are submitted and approved without restricted action page
What is the root cause of that problem?
When submitting or approving reports from the Reports page,
handleActionButtonPresscallssubmitMoneyRequestOnSearchandapproveMoneyRequestOnSearchdirectly without checking for billing grace period restrictions. These functions call the API directly, bypassing the restriction checks insubmitReportandapproveMoneyRequest.App/src/libs/actions/Search.ts
Line 148 in ccb3182
App/src/libs/actions/Search.ts
Line 155 in ccb3182
The Pay action already has the restriction check in
getPayActionCallbackviahandleBulkPayItemSelected, which is why only Pay shows the restricted action page.App/src/libs/actions/Search.ts
Lines 1348 to 1350 in ccb3182
What changes do you think we should make in order to solve the problem?
Add restriction checks in
handleActionButtonPressbefore callingsubmitMoneyRequestOnSearchandapproveMoneyRequestOnSearch:App/src/libs/actions/Search.ts
Lines 139 to 157 in ccb3182
Note: We should handle the bulk action as well
App/src/hooks/useSearchBulkActions.ts
Line 383 in ccb3182
App/src/hooks/useSearchBulkActions.ts
Line 809 in ccb3182
App/src/hooks/useSearchBulkActions.ts
Lines 525 to 526 in ccb3182
What alternative solutions did you explore? (Optional)
None
MelvinBot commentedon Mar 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user has an active billing grace period (
sharedNVP_private_billingGracePeriodEndset), submitting and approving reports from the Reports > Expenses (Search) view proceeds normally instead of showing the Restricted Action page. The Restricted Action page correctly appears when submitting/approving from the direct report view (e.g., via the report header), but the Search bulk actions bypass this check entirely.What is the root cause of that problem?
The Search bulk actions for Submit and Approve use completely separate code paths from the normal report view actions, and these paths never call
shouldRestrictUserBillableActionsto check the billing grace period:src/hooks/useSearchBulkActions.ts:796-818): TheonSelectedhandler directly callssubmitMoneyRequestOnSearch()(src/libs/actions/Search.ts:530) without any billing restriction check.src/hooks/useSearchBulkActions.ts:347-394):handleApproveWithDEWCheck()checks for delegate access and DEW policies, but never callsshouldRestrictUserBillableActions. It then callsapproveMoneyRequestOnSearch()(src/libs/actions/Search.ts:585) which also has no check.In contrast, the normal report view actions go through
submitReport()(src/libs/actions/IOU/index.ts:11477) andapproveMoneyRequest()(src/libs/actions/IOU/index.ts:10596), which both checkshouldRestrictUserBillableActionsand navigate toROUTES.RESTRICTED_ACTIONwhen the billing grace period is active.Note: The Pay sub-item selection path (
handleBulkPayItemSelectedatsrc/libs/actions/Search.ts:1348) does have the billing check, but theonBulkPaySelectedpath (src/hooks/useSearchBulkActions.ts:509) does not.What changes do you think we should make in order to solve the problem?
Add
shouldRestrictUserBillableActionschecks to the Search bulk actions flow insrc/hooks/useSearchBulkActions.ts:userBillingGraceEndPeriods(already loaded viauseOnyxinSearchBulkActionsButton.tsx:46) into theuseSearchBulkActionshook as a parameter.onSelectedhandler (around line 802) — before callingsubmitMoneyRequestOnSearch(), iterate through the selected items' policies and checkshouldRestrictUserBillableActions. If any policy is restricted, navigate toROUTES.RESTRICTED_ACTIONand return early instead of submitting.handleApproveWithDEWCheck(around line 347) — before callingapproveMoneyRequestOnSearch().onBulkPaySelected(around line 509) — before callingpayMoneyRequestOnSearch().This matches the pattern already used in
handleBulkPayItemSelectedatsrc/libs/actions/Search.ts:1348-1351.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.melvin-bot commentedon Mar 3, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (
External)[-]Reports - Reports are submitted and approved without restricted action page[/-][+][$250] Reports - Reports are submitted and approved without restricted action page[/+]melvin-bot commentedon Mar 3, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022028820653587894438
shubham1206agra commentedon Mar 3, 2026
@bernhardoj Can you look into this?
bernhardoj commentedon Mar 3, 2026
This isn't a regression. The approveMoneyRequestOnSearch never had the billing-expired check.
6 remaining items
melvin-bot commentedon Mar 24, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon Mar 24, 2026
Payment Summary
Contributor+: @dukenv0307 due $250 via NewDot
quinthar commentedon Mar 28, 2026
Approved $250 to @dukenv0307