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
Navigation - Repeating navigation after submitting expense and returning via device gesture #57497
Version Number: 9.1.6-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers):applausetester+sj9032@applause.expensifail.com Issue reported by: Applause Internal Team Device used: iPhone 15 Pro Max / iOS 18.3 App Component: Money Requests
Action Performed:
Launch ND or hybrid app.
Go to workspace chat that has no unsettled expense.
Submit an expense to the workspace chat.
Tap on the expense preview to go to expense report.
Tap + > Create expense.
Submit another expense in the expense report.
Swipe to right to go back (iOS gesture) - Result 1.
Swipe to right to go back (iOS gesture) - Result 2.
Swipe to right to go back (iOS gesture) - Result 3.
Swipe to right to go back (iOS gesture) - Result 4.
Swipe to right to go back (iOS gesture) - Result 5.
Swipe to right to go back (iOS gesture) - Result 6.
Swipe to right to go back (iOS gesture) - Result 7.
Swipe to right to go back (iOS gesture) - Result 8.
Expected Result:
In Step 7, app will return to main workspace chat.
In Step 8, app will return to LHN.
Actual Result:
Result 1 (Step 7) - App returns to LHN.
Result 2 (Step 8) - App returns to expense report.
Result 3 (Step 9) - App returns to LHN.
Result 4 (Step 10) - App returns to expense report.
Result 5 (Step 11) - App returns to Create expense page.
Result 6 (Step 12) - App returns to expense report.
Result 7 (Step 13) - App returns to main workspace chat.
Result 8 (Step 14) - App returns to LHN.
Hi, I've already looked into this and I think I've found the root cause of this problem.
It's caused by the race condition that appears when we're requesting money second time from the expense report.
In this case the app tries to navigate to the report twice from:
the scrollToBottomForCurrentUserAction method from src/pages/home/report/ReportActionsList.tsx it's triggered and Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID)); is called.
the requestMoney function from src/libs/actions/IOU.ts tries to dismiss the rhp and then navigate, but scrollToBottomForCurrentUserAction is called earlier. As a result, the RHP is not dismissed and we navigate to the same report second time.
I'm wondering if Navigation.navigate should be called in this case from scrollToBottomForCurrentUserAction. This issue appears only on native platforms as this method is not called on web.
@rinej Could you take a look at it? I see that you worked on scrollToBottomForCurrentUserAction and know how it should work. Should this method be called in this case? I'd like to fix it properly without causing new bugs :D
I believe I know how to fix this, but I would wait for that PR that is waiting to be merged as its logic is closely related to the code I need to touch to fix this issue
Activity
melvin-bot commentedon Feb 26, 2025
Triggered auto assignment to @trjExpensify (
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.trjExpensify commentedon Feb 27, 2025
@mountiny who would be good to look at this, and also is it worth it if we're making changes? 🤔
mountiny commentedon Mar 2, 2025
@WojtekBoman @adamgrzybowski would you be able to look into this one?
mountiny commentedon Mar 2, 2025
I think it is worth checking this one out
WojtekBoman commentedon Mar 3, 2025
Hi, I've already looked into this and I think I've found the root cause of this problem.
It's caused by the race condition that appears when we're requesting money second time from the expense report.
In this case the app tries to navigate to the report twice from:
scrollToBottomForCurrentUserActionmethod fromsrc/pages/home/report/ReportActionsList.tsxit's triggered andNavigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.reportID));is called.requestMoneyfunction fromsrc/libs/actions/IOU.tstries to dismiss the rhp and then navigate, butscrollToBottomForCurrentUserActionis called earlier. As a result, the RHP is not dismissed and we navigate to the same report second time.I'm wondering if
Navigation.navigateshould be called in this case fromscrollToBottomForCurrentUserAction. This issue appears only on native platforms as this method is not called on web.@rinej Could you take a look at it? I see that you worked on
scrollToBottomForCurrentUserActionand know how it should work. Should this method be called in this case? I'd like to fix it properly without causing new bugs :DtrjExpensify commentedon Mar 3, 2025
Excellent. @WojtekBoman, I've assigned you for now. 👍
mountiny commentedon Mar 3, 2025
Raised in here as well for a faster resolution
14 remaining items
WojtekBoman commentedon Mar 14, 2025
I will work on that :)
mountiny commentedon Mar 14, 2025
🎉
melvin-bot commentedon Mar 18, 2025
@WojtekBoman Whoops! This issue is 2 days overdue. Let's get this updated quick!
mountiny commentedon Mar 18, 2025
@WojtekBoman what is your eta for a pr?
WojtekBoman commentedon Mar 18, 2025
It should be ready by the end of the week
WojtekBoman commentedon Mar 20, 2025
I believe I know how to fix this, but I would wait for that PR that is waiting to be merged as its logic is closely related to the code I need to touch to fix this issue
cc @mountiny
mountiny commentedon Mar 20, 2025
Merging, lets also hope its not going to be reverted due to some blockers
mountiny commentedon Mar 24, 2025
I think we might be good to go here, nobody external to pay on this issue