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 - Filter buttons are not responsive after paying invoice #65579
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Version Number: 9.1.77-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Exp https://expensify.testrail.io/index.php?/cases/view/4090175 Email or phone of affected tester (no customers):sndoijsddinsjo@gmail.com Issue reported by: Applause Internal Team Device used: Mac 15.5 / Chrome App Component: Search
Action Performed:
Precondition:
User has received an invoice.
The invoice receiver will perform the following steps:
Go to staging.expensify.com
Go to Reports > Expenses.
Click Type:Expense.
Type list opens without issue.
Go to Inbox.
Open invoice room.
Click Pay.
Click Pay as an individual > Pay elsewhere.
Go to Reports > Expenses.
Click Type:Expense or other filter buttons (Status, Date, From).
Expected Result:
Type list will open without issue.
Actual Result:
Filter buttons are not responsive after paying invoice.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
was added in #63996 to fix the issue where we can open 2 dropdown buttons at the same time. But it accidentally also affects behaviour if there's other modals. So we can limit the logic to only apply when DropdownButton is already rendered on screen.
Add a previous value for willAlertModalBecomeVisible in DropdownButton
This way, when navigating from other pages, prevWillAlertModalBecomeVisible will be undefined and will not satisfy the condition above.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Reports - Filter buttons are not responsive after paying invoice[/-][+][$250] Reports - Filter buttons are not responsive after paying invoice[/+]on Jul 12, 2025
There is no need to use this props in our case. Instead of avoiding the real issue by applying the props one by one, we can have a global fix that fixes the root cause where the modal hide isn't called.
@bernhardoj are you suggesting we don’t need shouldCallAfterModalHide at all in the codebase, or only that it’s unnecessary in this particular case?
We still need it in the codebase, but not in this case. shouldCallAfterModalHide is useful when we are going to open another modal from a modal. That's why we also have many Modal.close usage. One of the examples
Yup, it makes sense. We're mostly using it with delete options, probably because it's followed by a delete confirmation modal.
But I think it makes sense in our case too. The issue happens because we're unmounting the settlement button before the popover closes. shouldCallAfterModalHide would make sure the unmount happens only after the modal is closed. Wouldn't that be the right approach? Do you see any potential shortcomings with this?
Regarding the approach you suggested, we can add a cleanup on unmounting as well. I’m okay with it, but I believe it should only be used as a fallback in case the popover isn’t closed properly beforehand.
I stumbled upon a weird issue while testing your solution—maybe I’m missing something:
shouldCallAfterModalHide would make sure the unmount happens only after the modal is closed. Wouldn't that be the right approach? Do you see any potential shortcomings with this?
True, but at this point, we just need to decide which approach is better. Using shouldCallAfterModalHide means the action will be delayed because it waits for the modal to close. From the UX perspective, I think the immediate action is better.
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Activity
melvin-bot commentedon Jul 7, 2025
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.Eskalifer1 commentedon Jul 7, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Reports - Filter buttons are not responsive after paying invoice
What is the root cause of that problem?
The reason is this if:
App/src/components/Search/FilterDropdowns/DropdownButton.tsx
Lines 74 to 76 in 3401ab2
The value of willAlertModalBecomeVisible is true, so we get into this if
I suspect that when unmounting this button, the ONYXKEYS.MODAL value does not have time to change to false, which is why the value remains true
What changes do you think we should make in order to solve the problem?
When unmounting this button, we can add the willAlertModalBecomeVisible(false) function:
App/src/components/SettlementButton/index.tsx
Line 22 in 3401ab2
Alternatively, we can add this to the function when selecting this value
App/src/hooks/usePaymentOptions.ts
Line 172 in 3401ab2
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
daledah commentedon Jul 7, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Filter buttons are not responsive after paying invoice.
What is the root cause of that problem?
When pressing "Pay as individual" button, we don't set
shouldCallAfterModalHide, so we callonSelectedwithout closing the modal:App/src/components/PopoverMenu.tsx
Lines 246 to 249 in f660f73
In
onSelected, we callstartAnimationApp/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx
Line 206 in b77bd4a
Which sets
isPaidAnimationRunningastrueApp/src/hooks/usePaymentAnimations.ts
Lines 13 to 14 in b77bd4a
And sets
isAnimationRunninghere totrueApp/src/components/SettlementButton/AnimatedSettlementButton.tsx
Line 33 in b77bd4a
This action causes
SettlementButtonto be forcefully unmounted, without closing the active modal first:App/src/components/SettlementButton/AnimatedSettlementButton.tsx
Lines 117 to 124 in b77bd4a
So the logics here is not triggered properly
App/src/components/PopoverWithoutOverlay/index.tsx
Lines 50 to 76 in 30d781e
And
willAlertModalBecomeVisibleremainstrue. This will always prevent opening filter options:App/src/components/Search/FilterDropdowns/DropdownButton.tsx
Line 74 in b77bd4a
What changes do you think we should make in order to solve the problem?
We should force closing modal before calling
onSelectedfunction forSettlementButtonAdd
shouldCallModalAfterHide: trueto allsubMenuItemshere:App/src/hooks/usePaymentOptions.ts
Line 166 in f660f73
and here:
App/src/hooks/usePaymentOptions.ts
Line 188 in f660f73
Note
There has been a couple issues related to the
DropdownButtoncomponent, so I suggest add an additional fix to that component as wellThe logic here
App/src/components/Search/FilterDropdowns/DropdownButton.tsx
Line 74 in f660f73
was added in #63996 to fix the issue where we can open 2 dropdown buttons at the same time. But it accidentally also affects behaviour if there's other modals. So we can limit the logic to only apply when
DropdownButtonis already rendered on screen.Add a previous value for
willAlertModalBecomeVisibleinDropdownButtonThen update here
App/src/components/Search/FilterDropdowns/DropdownButton.tsx
Line 74 in 41b1885
This way, when navigating from other pages,
prevWillAlertModalBecomeVisiblewill beundefinedand will not satisfy the condition above.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
bernhardoj commentedon Jul 8, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Filter buttons are not responsive after paying invoice.
What is the root cause of that problem?
When the payment option is visible,
willAlertModalBecomeVisiblebecomes true, and the value is stuck at true.App/src/components/Search/FilterDropdowns/DropdownButton.tsx
Lines 72 to 76 in 30d781e
When we pay the invoice, the settlement button is immediately unmounted because
isAnimationRunningis true.App/src/components/SettlementButton/AnimatedSettlementButton.tsx
Lines 103 to 124 in 30d781e
We already have a logic to handle the case when a modal is unmounted without being closed first by triggering the modal hide callback on unmount.
App/src/components/Modal/BaseModal.tsx
Lines 175 to 185 in 30d781e
App/src/components/Modal/BaseModal.tsx
Lines 135 to 139 in 30d781e
However, in this case, it uses a PopoverWithoutOverlay, which doesn't have that logic yet.
What changes do you think we should make in order to solve the problem?
Add the unmount logic to PopoverWithoutOverlay too.
This is enough to fix our issue, but we can improve it further by:
Move this into a function and then call it when unmount, just like in BaseModal.
App/src/components/PopoverWithoutOverlay/index.tsx
Lines 61 to 66 in 30d781e
Instead of using
isVisibleRef, we can useshouldCallHideModalOnUnmountref. We setshouldCallHideModalOnUnmountto true when the modal is visible,App/src/components/PopoverWithoutOverlay/index.tsx
Lines 52 to 55 in 30d781e
and set it to false when the modal hides,
App/src/components/PopoverWithoutOverlay/index.tsx
Lines 61 to 62 in 30d781e
This is to avoid this kind of issue.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
melvin-bot commentedon Jul 11, 2025
@bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
[-]Reports - Filter buttons are not responsive after paying invoice[/-][+][$250] Reports - Filter buttons are not responsive after paying invoice[/+]melvin-bot commentedon Jul 12, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021944040694556444245
19 remaining items
sobitneupane commentedon Jul 23, 2025
@bernhardoj are you suggesting we don’t need
shouldCallAfterModalHideat all in the codebase, or only that it’s unnecessary in this particular case?bernhardoj commentedon Jul 23, 2025
We still need it in the codebase, but not in this case.
shouldCallAfterModalHideis useful when we are going to open another modal from a modal. That's why we also have manyModal.closeusage. One of the examplesApp/src/pages/settings/Security/SecuritySettingsPage.tsx
Lines 276 to 288 in 5249e91
sobitneupane commentedon Jul 24, 2025
Thanks for the update @bernhardoj
Yup, it makes sense. We're mostly using it with delete options, probably because it's followed by a delete confirmation modal.
But I think it makes sense in our case too. The issue happens because we're unmounting the settlement button before the popover closes.
shouldCallAfterModalHidewould make sure the unmount happens only after the modal is closed. Wouldn't that be the right approach? Do you see any potential shortcomings with this?sobitneupane commentedon Jul 24, 2025
Regarding the approach you suggested, we can add a cleanup on unmounting as well. I’m okay with it, but I believe it should only be used as a fallback in case the popover isn’t closed properly beforehand.
I stumbled upon a weird issue while testing your solution—maybe I’m missing something:
Screen.Recording.2025-07-24.at.18.23.05.mov
bernhardoj commentedon Jul 25, 2025
I can't repro the issue.
True, but at this point, we just need to decide which approach is better. Using
shouldCallAfterModalHidemeans the action will be delayed because it waits for the modal to close. From the UX perspective, I think the immediate action is better.I'll leave the decision up to you and @NikkiWines
melvin-bot commentedon Jul 25, 2025
@NikkiWines Whoops! This issue is 2 days overdue. Let's get this updated quick!
mvtglobally commentedon Jul 26, 2025
Issue not reproducible during KI retests. (First week)
melvin-bot commentedon Jul 26, 2025
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
NikkiWines commentedon Jul 28, 2025
I'm also unable to reproduce the issue on staging now - looks like maybe no action is needed here now 😅
Screen.Recording.2025-07-28.at.12.28.59.mov
izarutskaya commentedon Jul 28, 2025
Not reproducible
bandicam.2025-07-28.15-34-36-296.mp4
bfitzexpensify commentedon Jul 28, 2025
Ok, let's close this out then