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 - Missing Remove from report option for non-reimbursable expense in retracted report #88424
Version Number: 9.3.61-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#84832 Email or phone of affected tester (no customers):osijdnosijdosjdoij@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
👋 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.
Classification: Frontend bug Causing PR: #84832 - "Fix: Filter ineligible reports in useOutstandingReports hook" by @abzokhattab (High confidence) Related Issues: #70423 (the issue PR #84832 was meant to fix)
Recommendation: REVERT
PR #84832 introduced a regression where filtering all reports as ineligible causes the "Remove from report" option to be hidden. Reverting is the cleanest fix since the change is contained to useOutstandingReports.ts.
Assigned: @abzokhattab (PR author), @joekaufmanexpensify, @grgia, @huult (approving reviewers) from highest-confidence causing PR only Labels: DeployBlockerCash kept (Frontend bug — App PR caused the issue). No label changes made.
PR Fix: Filter ineligible reports in useOutstandingReports hook #84832 modifies src/hooks/useOutstandingReports.ts to filter out reports using isReportIneligibleForMoveExpenses. When the workspace has Instant Submit enabled, Approvals disabled, and Payments disabled, a retracted non-reimbursable expense report is considered ineligible, causing useOutstandingReports to return an empty array.
The bug is only reproducible on staging (not production), which is consistent with a recently merged staging-only PR.
The consuming component src/pages/iou/request/step/IOURequestEditReportCommon.tsx (line 270) has logic: if (outstandingReports.length === 0 || shouldShowNotFoundPageFromProps) { return true; } for shouldShowNotFoundPage. When outstandingReports is empty (due to the new filter), shouldShowNotFoundPage becomes true, and StepScreenWrapper renders a "Not Found" page instead of the report selection list.
The "Remove from report" option is rendered as listFooterContent of the SelectionList (lines 311-319 of IOURequestEditReportCommon.tsx), which is never rendered when the "Not Found" page is shown — even though shouldShowRemoveFromReport (lines 118-123) would otherwise be true.
Root Cause
isReportIneligibleForMoveExpenses in ReportUtils.ts (line 2788) returns true for non-draft reports in workspaces with Instant Submit + Submit & Close + only non-reimbursable transactions. After Retract, the report is not in draft state (isDraftReport returns false), so the filter removes it. With no eligible outstanding reports, outstandingReports.length === 0, which triggers the "Not Found" page branch in IOURequestEditReportCommon, hiding the entire list including the "Remove from report" footer option. The fix should either: (a) not show the "Not Found" page when shouldShowRemoveFromReport is true, or (b) ensure the filtering logic correctly handles retracted reports. However, the safest immediate action is to revert PR #84832.
PR #84832 added filterEligibleReports in useOutstandingReports.ts which calls isReportIneligibleForMoveExpenses to filter out reports that shouldn't be move targets. For a retracted report under a policy with instant submit + submit-and-close (approvals disabled) containing only non-reimbursable expenses, isReportIneligibleForMoveExpenses returns true — filtering the report out entirely.
This makes outstandingReports empty in IOURequestEditReportCommon.tsx, which causes shouldShowNotFoundPage to evaluate to true (line ~270), replacing the entire page with a "Not Found" view and hiding the "Remove from report" button that lives in listFooterContent.
The filter is meant to exclude ineligible destination reports for moving expenses, but it also incorrectly excludes the current/source report the expense already belongs to.
What changes do you think we should make in order to solve the problem?
In useOutstandingReports.ts, exclude the currently-selected report from filterEligibleReports so the report the expense is already on always remains in the list. The current report should bypass the eligibility filter since the user isn't "moving" the expense there — they're viewing it to access options like "Remove from report."
Alternatively, in IOURequestEditReportCommon.tsx, adjust the shouldShowNotFoundPage logic so it does not trigger when shouldShowRemoveFromReport would be true — ensuring the remove option remains accessible even when no other eligible reports exist.
What alternative solutions did you explore? (Optional)
Modifying isReportIneligibleForMoveExpenses itself to exclude retracted/open reports was considered, but that would change the semantics of the utility broadly. Scoping the fix to either useOutstandingReports (don't filter the current report) or shouldShowNotFoundPage (don't hide when remove-from-report applies) is more targeted and less risky.
Supporting evidence
isReportIneligibleForMoveExpenses (App/src/libs/ReportUtils.ts:2788-2793): Returns true when isInstantSubmitEnabled(policy) && isSubmitAndClose(policy) && hasOnlyNonReimbursableTransactions(reportID) — exactly matching the bug scenario (Submission=Instantly, Approvals=disabled, non-reimbursable expense).
shouldShowNotFoundPage (App/src/pages/iou/request/step/IOURequestEditReportCommon.tsx:265-270): Triggers when outstandingReports.length === 0 and no createReportOption exists, replacing the full page.
"Remove from report" button (App/src/pages/iou/request/step/IOURequestEditReportCommon.tsx:311-319): Rendered as listFooterContent inside a SelectionList that is a child of FullPageNotFoundView — hidden when shouldShowNotFoundPage is true.
shouldShowRemoveFromReport (App/src/pages/iou/request/step/IOURequestEditReportCommon.tsx:118-123): Would evaluate to true for this scenario, but is never reached because the Not Found page replaces all children first.
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.
Activity
melvin-bot commentedon Apr 21, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #84832
melvin-bot commentedon Apr 21, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 21, 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:
OSBotify commentedon Apr 21, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #84832 - "Fix: Filter ineligible reports in useOutstandingReports hook" by @abzokhattab (High confidence)
Related Issues: #70423 (the issue PR #84832 was meant to fix)
Recommendation: REVERT
PR #84832 introduced a regression where filtering all reports as ineligible causes the "Remove from report" option to be hidden. Reverting is the cleanest fix since the change is contained to
useOutstandingReports.ts.Assigned: @abzokhattab (PR author), @joekaufmanexpensify, @grgia, @huult (approving reviewers) from highest-confidence causing PR only
Labels:
DeployBlockerCashkept (Frontend bug — App PR caused the issue). No label changes made.Detailed Analysis
Evidence
src/hooks/useOutstandingReports.tsto filter out reports usingisReportIneligibleForMoveExpenses. When the workspace has Instant Submit enabled, Approvals disabled, and Payments disabled, a retracted non-reimbursable expense report is considered ineligible, causinguseOutstandingReportsto return an empty array.Verification
src/hooks/useOutstandingReports.ts— directly modified by PR Fix: Filter ineligible reports in useOutstandingReports hook #84832.src/pages/iou/request/step/IOURequestEditReportCommon.tsx(line 270) has logic:if (outstandingReports.length === 0 || shouldShowNotFoundPageFromProps) { return true; }forshouldShowNotFoundPage. WhenoutstandingReportsis empty (due to the new filter),shouldShowNotFoundPagebecomestrue, andStepScreenWrapperrenders a "Not Found" page instead of the report selection list.listFooterContentof theSelectionList(lines 311-319 ofIOURequestEditReportCommon.tsx), which is never rendered when the "Not Found" page is shown — even thoughshouldShowRemoveFromReport(lines 118-123) would otherwise betrue.Root Cause
isReportIneligibleForMoveExpensesinReportUtils.ts(line 2788) returnstruefor non-draft reports in workspaces with Instant Submit + Submit & Close + only non-reimbursable transactions. After Retract, the report is not in draft state (isDraftReportreturnsfalse), so the filter removes it. With no eligible outstanding reports,outstandingReports.length === 0, which triggers the "Not Found" page branch inIOURequestEditReportCommon, hiding the entire list including the "Remove from report" footer option. The fix should either: (a) not show the "Not Found" page whenshouldShowRemoveFromReportis true, or (b) ensure the filtering logic correctly handles retracted reports. However, the safest immediate action is to revert PR #84832.MelvinBot commentedon Apr 21, 2026
Proposal
What is the root cause of that problem?
PR #84832 added
filterEligibleReportsinuseOutstandingReports.tswhich callsisReportIneligibleForMoveExpensesto filter out reports that shouldn't be move targets. For a retracted report under a policy with instant submit + submit-and-close (approvals disabled) containing only non-reimbursable expenses,isReportIneligibleForMoveExpensesreturnstrue— filtering the report out entirely.This makes
outstandingReportsempty inIOURequestEditReportCommon.tsx, which causesshouldShowNotFoundPageto evaluate totrue(line ~270), replacing the entire page with a "Not Found" view and hiding the "Remove from report" button that lives inlistFooterContent.The filter is meant to exclude ineligible destination reports for moving expenses, but it also incorrectly excludes the current/source report the expense already belongs to.
What changes do you think we should make in order to solve the problem?
In
useOutstandingReports.ts, exclude the currently-selected report fromfilterEligibleReportsso the report the expense is already on always remains in the list. The current report should bypass the eligibility filter since the user isn't "moving" the expense there — they're viewing it to access options like "Remove from report."Alternatively, in
IOURequestEditReportCommon.tsx, adjust theshouldShowNotFoundPagelogic so it does not trigger whenshouldShowRemoveFromReportwould betrue— ensuring the remove option remains accessible even when no other eligible reports exist.What alternative solutions did you explore? (Optional)
Modifying
isReportIneligibleForMoveExpensesitself to exclude retracted/open reports was considered, but that would change the semantics of the utility broadly. Scoping the fix to eitheruseOutstandingReports(don't filter the current report) orshouldShowNotFoundPage(don't hide when remove-from-report applies) is more targeted and less risky.Supporting evidence
isReportIneligibleForMoveExpenses(App/src/libs/ReportUtils.ts:2788-2793): ReturnstruewhenisInstantSubmitEnabled(policy) && isSubmitAndClose(policy) && hasOnlyNonReimbursableTransactions(reportID)— exactly matching the bug scenario (Submission=Instantly, Approvals=disabled, non-reimbursable expense).filterEligibleReports(App/src/hooks/useOutstandingReports.ts:25-29): New filter from PR Fix: Filter ineligible reports in useOutstandingReports hook #84832 that removes these reports from the outstanding reports list.shouldShowNotFoundPage(App/src/pages/iou/request/step/IOURequestEditReportCommon.tsx:265-270): Triggers whenoutstandingReports.length === 0and nocreateReportOptionexists, replacing the full page.App/src/pages/iou/request/step/IOURequestEditReportCommon.tsx:311-319): Rendered aslistFooterContentinside aSelectionListthat is a child ofFullPageNotFoundView— hidden whenshouldShowNotFoundPageistrue.shouldShowRemoveFromReport(App/src/pages/iou/request/step/IOURequestEditReportCommon.tsx:118-123): Would evaluate totruefor this scenario, but is never reached because the Not Found page replaces all children first.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.