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 2025-03-21] [$250] Reports - Merchant page is not dismissed after clicking Discard changes #57512
Version Number: 9.1.7-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: Exp Email or phone of affected tester (no customers):applausetester+923093292@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Mac 15.3 / Chrome App Component: Search
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Submit an expense.
Go to Reports.
Click on the expense from Step 3.
Click Merchant.
Edit the merchant but do not click Save.
Click RHP back button.
Click Discard changes.
Expected Result:
Merchant page will be dismissed after clicking Discard changes.
Actual Result:
Merchant page is not dismissed after clicking Discard changes.
As we can see, the target refers to the RightModalNavigator, but the current screen is in MoneyRequest, so dispatching the pop action above does nothing.
What changes do you think we should make in order to solve the problem?
We can remove the target prop from the navigation action so the POP action will start from MoneyRequest and bubble to other navigators if not handled by the current navigator:
If we open the merchant page from the report RHP, the RightModalNavigator has 2 routes: [ReportRHP, MerchantPage]. So, popping 1 screen will pop MerchantPage. However, it has no effect at all.
That's because we dispatch the navigation action using the navigation object from useNavigation, which in this case, is the navigation object from merchant screen.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
I think we can test by rendering the navigation container with the RightModalNavigator, then navigate to the merchant page with backTo param and simulate the action done in this issue.
changed the title [-]Reports - Merchant page is not dismissed after clicking Discard changes[/-][+][$250] Reports - Merchant page is not dismissed after clicking Discard changes[/+]on Feb 27, 2025
I agree with the RCA that the navigation object obtained via useNavigation within DiscardChangesConfirmation is scoped to the nearest stack. As a result, this navigation object does not include the stack on which the dispatched action for goBack (and consequently goUp) should act.
Instead of removing the target of this action, I think we should provide the correct navigation object in DiscardChangesConfirmation for this action to execute properly. So, @bernhardoj’s proposal to dispatch the action on the root ref looks good to me!
changed the title [-][$250] Reports - Merchant page is not dismissed after clicking Discard changes[/-][+][Due for payment 2025-03-21] [$250] Reports - Merchant page is not dismissed after clicking Discard changes[/+]on Mar 14, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.12-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@c3024@slafortune@c3024 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] 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: The added modal is a new feature. This is not a critical bug so no discussion was started.
[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
melvin-bot commentedon Feb 27, 2025
Triggered auto assignment to @slafortune (
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.truph01 commentedon Feb 27, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
App/src/pages/iou/request/step/DiscardChangesConfirmation.tsx
Line 44 in 5b10645
with the navigation action is:
As we can see, the target refers to the
RightModalNavigator, but the current screen is inMoneyRequest, so dispatching the pop action above does nothing.What changes do you think we should make in order to solve the problem?
targetprop from the navigation action so thePOPaction will start fromMoneyRequestand bubble to other navigators if not handled by the current navigator:App/src/pages/iou/request/step/DiscardChangesConfirmation.tsx
Line 44 in 5b10645
POP.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
bernhardoj commentedon Feb 27, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Merchant page isn't dismissed when discarding merchant changes if we open it from report RHP.
What is the root cause of that problem?
When we confirm the discard, it will dispatch whatever action that is previously prevented.
App/src/pages/iou/request/step/DiscardChangesConfirmation.tsx
Lines 18 to 31 in 5b10645
App/src/pages/iou/request/step/DiscardChangesConfirmation.tsx
Lines 41 to 46 in 5b10645
In our case, it's a POP action from our
goUpfunction. The target of the pop is the RightModalNavigator with a count of 1.App/src/libs/Navigation/Navigation.ts
Line 300 in 5b10645
If we open the merchant page from the report RHP, the RightModalNavigator has 2 routes: [ReportRHP, MerchantPage]. So, popping 1 screen will pop MerchantPage. However, it has no effect at all.
That's because we dispatch the navigation action using the
navigationobject fromuseNavigation, which in this case, is the navigation object from merchant screen.App/src/pages/iou/request/step/DiscardChangesConfirmation.tsx
Line 44 in 5b10645
compared to the
goUpwhere we usenavigationRefwhich is the root one.App/src/libs/Navigation/Navigation.ts
Line 300 in 5b10645
What changes do you think we should make in order to solve the problem?
We need to dispatch the action using navigationRef too in discard logic.
App/src/pages/iou/request/step/DiscardChangesConfirmation.tsx
Line 44 in 5b10645
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
I think we can test by rendering the navigation container with the RightModalNavigator, then navigate to the merchant page with backTo param and simulate the action done in this issue.
[-]Reports - Merchant page is not dismissed after clicking Discard changes[/-][+][$250] Reports - Merchant page is not dismissed after clicking Discard changes[/+]melvin-bot commentedon Feb 27, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021895179711497701073
melvin-bot commentedon Feb 27, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 (
External)c3024 commentedon Feb 28, 2025
Thanks for the proposals.
I agree with the RCA that the
navigationobject obtained viauseNavigationwithinDiscardChangesConfirmationis scoped to the nearest stack. As a result, thisnavigationobject does not include the stack on which the dispatched action forgoBack(and consequentlygoUp) should act.Instead of removing the target of this action, I think we should provide the correct
navigationobject inDiscardChangesConfirmationfor this action to execute properly. So, @bernhardoj’s proposal to dispatch the action on the root ref looks good to me!c3024 commentedon Feb 28, 2025
🎀 👀 🎀 C+ reviewed!
16 remaining items
[-][$250] Reports - Merchant page is not dismissed after clicking Discard changes[/-][+][Due for payment 2025-03-21] [$250] Reports - Merchant page is not dismissed after clicking Discard changes[/+]melvin-bot commentedon Mar 14, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 14, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.12-7 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 2025-03-21. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 14, 2025
@c3024 @slafortune @c3024 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]
c3024 commentedon Mar 20, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: https://github.com/Expensify/App/pull/54176/files#r2004997401
[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: The added modal is a new feature. This is not a critical bug so no discussion was started.
[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:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Mar 21, 2025
Payment Summary
Upwork Job
BugZero Checklist (@slafortune)
bernhardoj commentedon Mar 21, 2025
Requested in ND.
slafortune commentedon Mar 22, 2025
Role Contributor - @bernhardoj owed $250 via NewDot
Role C+ - @c3024 owed $250 via NewDot
JmillsExpensify commentedon Mar 24, 2025
$250 approved for @bernhardoj
JmillsExpensify commentedon Apr 9, 2025
$250 approved for @c3024