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
[PAY 6TH MARCH] iOS - Expense - No educational panel when an approver rejects an expense for the first time #81276
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Version Number: v9.3.11-24 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/27754595/test-cases/77992811 Email or phone of affected tester (no customers):expensify416+da2@gmail.com Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: iPhone 12/ iOS 18 App Component: Money Requests
Action Performed:
Preconditions
Owner invites an approver and member to a workspace
Change the workspace approver from owner to the invited approver
Approver account has never rejected an expense before.
Submitter has submitted at least 3 expenses to the Approver
Log in as an Approver who has never rejected an expense
Open a submitted expense report
Select an expense > "More" menu > Select "Reject"
Expected Result:
An educational panel (RHP) should appear explaining the difference between "Hold" and "Reject"
Please re-state the problem that we are trying to solve in this issue.
On iOS, when an approver rejects an expense for the first time, the educational panel explaining Hold vs Reject doesn't appear. It works correctly on other platforms.
What is the root cause of that problem?
The HoldOrRejectEducationalModal component uses useBeforeRemove(onClose) which listens for navigation beforeRemove events and calls the onClose callback whenever one fires. On iOS, when the bottom-docked popover menu closes, the navigation state changes can trigger a beforeRemove event, which immediately calls onClose. This sets rejectModalAction to null and unmounts the modal before the InteractionManager.runAfterInteractions callback in FeatureTrainingModal has a chance to set isModalVisible = true.
What changes do you think we should make in order to solve the problem?
Remove the useBeforeRemove hook from HoldOrRejectEducationalModal. This hook was intended to handle navigation cleanup, but since the modal passes shouldGoBack={false} to FeatureTrainingModal, it doesn't need navigation-based dismissal. The modal's own onClose handler (passed via props) already handles proper cleanup when the user confirms or dismisses the modal via its UI controls.
Please re-state the problem that we are trying to solve in this issue.
On iOS, when an approver who has never rejected an expense selects "Reject" from the More menu on an expense, the educational panel (RHP) explaining the difference between "Hold" and "Reject" does not appear.
What is the root cause of that problem?
The FeatureTrainingModal component uses InteractionManager.runAfterInteractions() to set modal visibility, which can fail to execute or be delayed indefinitely on iOS when there are pending interactions from previous modal animations.
On iOS, the InteractionManager queue gets stuck because the popover close animation leaves pending interactions. This is a known issue - the codebase has been systematically removing InteractionManager usage (e.g., PRs #75409, #76586, #75381).
What changes do you think we should make in order to solve the problem?
Remove the InteractionManager.runAfterInteractions() wrapper in FeatureTrainingModal and set modal visibility directly based on the isModalDisabled prop.
Please re-state the problem that we are trying to solve in this issue.
An approver who has never rejected an expense does not see the Hold/Reject educational panel when they select Reject, either single or bulk, on iOS, and the reject action continues without showing the required educational help.
What is the root cause of that problem?
In this flow, the earliest incorrect assumption is that setting header-local state to trigger the educational modal is reliable. In src/components/MoneyReportHeader.tsx, the logic assumes the header will stay mounted long enough to render the modal after setRejectModalAction is called, but on iOS the native menu close or navigation can unmount the header first, so the modal never appears and the invariant is broken.
What changes do you think we should make in order to solve the problem?
Apply the smallest shared-layer fix by moving modal presentation to the global modal stack owned by ModalProvider. Add a small shared hook that always shows the Hold/Reject educational modal through showModal, and update all reject entry points to use this hook instead of header-local state.
Files changed include one new hook and three small call-site updates.
New file: src/hooks/useHoldRejectEducationalModal.tsx
Please re-state the problem that we are trying to solve in this issue.
The educational modal is not displayed when rejecting transactions.
What is the root cause of that problem?
On narrow screens, the reject button is rendered under the “selected” actions menu, but this flow does not handle the “first-time reject” case where the educational modal should be shown.
@truph01’s proposal looks good to me. The root cause is correct — we don’t handle showing the modal in MoneyRequestReportActionsList the same way we do in MoneyReportHeader and MoneyRequestHeader.
[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:
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Log in as an Approver who has never rejected an expense
Test:
Open a submitted expense report
Select an expense > "More" menu > Select "Reject"
Verify: An educational panel (RHP) should appear explaining the difference between "Hold" and "Reject"
changed the title [-]iOS - Expense - No educational panel when an approver rejects an expense for the first time[/-][+][PAY 6TH MARCH] iOS - Expense - No educational panel when an approver rejects an expense for the first time[/+]on Mar 3, 2026
BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2
Activity
melvin-bot commentedon Feb 3, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Krishna2323 (
External)melvin-bot commentedon Feb 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.MobileMage commentedon Feb 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS, when an approver rejects an expense for the first time, the educational panel explaining Hold vs Reject doesn't appear. It works correctly on other platforms.
What is the root cause of that problem?
The
HoldOrRejectEducationalModalcomponent usesuseBeforeRemove(onClose)which listens for navigationbeforeRemoveevents and calls theonClosecallback whenever one fires. On iOS, when the bottom-docked popover menu closes, the navigation state changes can trigger abeforeRemoveevent, which immediately callsonClose. This setsrejectModalActiontonulland unmounts the modal before theInteractionManager.runAfterInteractionscallback inFeatureTrainingModalhas a chance to setisModalVisible = true.App/src/components/HoldOrRejectEducationalModal.tsx
Lines 34 to 36 in 0716397
What changes do you think we should make in order to solve the problem?
Remove the
useBeforeRemovehook fromHoldOrRejectEducationalModal. This hook was intended to handle navigation cleanup, but since the modal passesshouldGoBack={false}toFeatureTrainingModal, it doesn't need navigation-based dismissal. The modal's ownonClosehandler (passed via props) already handles proper cleanup when the user confirms or dismisses the modal via its UI controls.function HoldOrRejectEducationalModal({onClose, onConfirm}: HoldOrRejectEducationalModalProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); const illustrations = useMemoizedLazyIllustrations(['Stopwatch', 'Rules', 'RealtimeReport', 'ThumbsDown', 'ModalHoldOrReject']); - useBeforeRemove(onClose); - const menuSections: SectionMenuItem[] = [What alternative solutions did you explore? (Optional)
N/A
TaduJR commentedon Feb 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
On iOS, when an approver who has never rejected an expense selects "Reject" from the More menu on an expense, the educational panel (RHP) explaining the difference between "Hold" and "Reject" does not appear.
What is the root cause of that problem?
The
FeatureTrainingModalcomponent usesInteractionManager.runAfterInteractions()to set modal visibility, which can fail to execute or be delayed indefinitely on iOS when there are pending interactions from previous modal animations.Root Cause Flow:
User clicks "Reject" from the dropdown menu
App/src/components/MoneyRequestHeader.tsx
Lines 489 to 494 in b7dc545
PopoverMenuschedules callback viaclose()withshouldCallAfterModalHide: trueApp/src/components/ButtonWithDropdownMenu/index.tsx
Line 302 in b7dc545
After popover closes,
setRejectModalAction()triggersHoldOrRejectEducationalModalrenderApp/src/components/MoneyRequestHeader.tsx
Lines 632 to 637 in b7dc545
FeatureTrainingModalmounts and usesInteractionManager.runAfterInteractions()to show modalApp/src/components/FeatureTrainingModal.tsx
Lines 215 to 224 in b7dc545
On iOS, the
InteractionManagerqueue gets stuck because the popover close animation leaves pending interactions. This is a known issue - the codebase has been systematically removingInteractionManagerusage (e.g., PRs #75409, #76586, #75381).What changes do you think we should make in order to solve the problem?
Remove the
InteractionManager.runAfterInteractions()wrapper inFeatureTrainingModaland set modal visibility directly based on theisModalDisabledprop.File:
src/components/FeatureTrainingModal.tsxApp/src/components/FeatureTrainingModal.tsx
Lines 215 to 224 in b7dc545
Change:
Also remove the unused
InteractionManagerimport from line 4:App/src/components/FeatureTrainingModal.tsx
Line 4 in b7dc545
What alternative solutions did you explore? (Optional)
requestAnimationFrame- We Could also replaceInteractionManagerwithrequestAnimationFramequeueMicrotask- Similar to the pattern used in other parts of the codebase when removingInteractionManagertwinkle-react commentedon Feb 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
An approver who has never rejected an expense does not see the Hold/Reject educational panel when they select Reject, either single or bulk, on iOS, and the reject action continues without showing the required educational help.
What is the root cause of that problem?
In this flow, the earliest incorrect assumption is that setting header-local state to trigger the educational modal is reliable. In
src/components/MoneyReportHeader.tsx, the logic assumes the header will stay mounted long enough to render the modal aftersetRejectModalActionis called, but on iOS the native menu close or navigation can unmount the header first, so the modal never appears and the invariant is broken.What changes do you think we should make in order to solve the problem?
Apply the smallest shared-layer fix by moving modal presentation to the global modal stack owned by
ModalProvider. Add a small shared hook that always shows the Hold/Reject educational modal throughshowModal, and update all reject entry points to use this hook instead of header-local state.Files changed include one new hook and three small call-site updates.
New file:
src/hooks/useHoldRejectEducationalModal.tsxModify
src/components/MoneyReportHeader.tsxAdd the import and initialize the hook.
Replace the existing function with a compatible version that accepts an optional action.
Replace all
setRejectModalAction(...)usages.Modify
src/components/MoneyRequestHeader.tsxAdd the import and initialize the hook.
Replace the reject call site.
Modify
src/pages/Search/SearchPage.tsxAdd the import and initialize the hook.
Replace the bulk reject path when the explanation is not dismissed.
What alternative solutions did you explore? (Optional)
None
truph01 commentedon Feb 3, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
On narrow screens, the reject button is rendered under the “selected” actions menu, but this flow does not handle the “first-time reject” case where the educational modal should be shown.
App/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Line 690 in e4b61ff
On large screens, this logic is already implemented and works as expected:
App/src/components/MoneyReportHeader.tsx
Line 1775 in e4b61ff
App/src/components/MoneyReportHeader.tsx
Lines 1679 to 1701 in e4b61ff
As a result, behavior is inconsistent between narrow and large screen layouts.
What changes do you think we should make in order to solve the problem?
1. Update selected transaction options
App/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Line 217 in e4b61ff
2. Render the educational modal
App/src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx
Line 841 in e4b61ff
This mirrors the large screen behavior and ensures the educational modal is shown consistently across screen sizes.
What alternative solutions did you explore? (Optional)
Krishna2323 commentedon Feb 7, 2026
@truph01’s proposal looks good to me. The root cause is correct — we don’t handle showing the modal in
MoneyRequestReportActionsListthe same way we do inMoneyReportHeaderandMoneyRequestHeader.🎀 👀 🎀
C+ Reviewed
9 remaining items
truph01 commentedon Feb 13, 2026
@Krishna2323 PR is ready
Krishna2323 commentedon Mar 3, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: Hold and Reject Role based Modal updates #74505 (comment)
[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:
[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.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
jliexpensify commentedon Mar 3, 2026
I think this was deployed to prod 4 days ago, correct?
Krishna2323 commentedon Mar 3, 2026
Yes - #82473 (comment)
[-]iOS - Expense - No educational panel when an approver rejects an expense for the first time[/-][+][PAY 6TH MARCH] iOS - Expense - No educational panel when an approver rejects an expense for the first time[/+]jliexpensify commentedon Mar 3, 2026
Payment Summary
JmillsExpensify commentedon Mar 18, 2026
$250 approved for @truph01
Krishna2323 commentedon Apr 4, 2026
Requested in ND.
twisterdotcom commentedon Apr 5, 2026
@Krishna2323 has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-70a9-a077-914f-a8cfff5af0f4quinthar commentedon Apr 13, 2026
Approved $250 to @Krishna2323