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
[$500] Request Money - After Reloading on Receipt page the back button takes you to main chat #31869
Version Number: 1.4.3-6 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Go to FAB > Request money
Switch to Manual
Enter amount > Next
Select a user
On the confirm page go to 'more', the three dots at the top
Add receipt
On the Receipt page, Reload the page
Click the back button, and notice you are retaken to the receipt page
Click the back button again
Expected Result:
Navigates back to the previous page or reloading takes you to the Request money page
Actual Result:
After Reloading on the Receipt page clicking the back button retakes you to the receipt page again and clicking back again takes you to the main chat
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Request Money - After Reloading on Receipt page the back button takes you to main chat[/-][+][$500] Request Money - After Reloading on Receipt page the back button takes you to main chat[/+]on Nov 25, 2023
After Reloading on Receipt page the back button takes you to main chat
Root Cause
In EditRequestReceiptPage, for onBackButtonPress in HeaderWithBackButton we we dont provide a fallback route so it just links back to the home when the route is first in the modal stack after reload.
Changes
We should set a backTo param while navigating to the receipt selector from money request confirm page and provide it as fallback route in goBack,so when app is reloaded and back button links to correct page.
Note: using a definte fallback route or setting fallback based on condition is not a good idea when we integrate edit receipt page to some other flow conditions may fail and and component needs a refactor again and i dont think thats a good idea.
const fallBackRoute = transactionID ? ' ' : ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(iou.iouType, iou.iouReportID); // transactionID to check if it is edit request`s receipt or add a receipt to new request flow
iou.iouType and iou.iouReportID are used to store the previous iouType and reportID (before refreshing the page). We can update these variable by updating:
Please re-state the problem that we are trying to solve in this issue.
The Back button does not behave as expected on page refresh on the desktop. The back button must be pressed twice and the 2nd time pressed it dimisses the Request Money prompt.
What is the root cause of that problem?
There are 2 issues that need to be addressed: 1) The URL changes on refresh, and 2) there is missing fallback route for the onBack
When refreshing the URL changes (trailing slash is lost and adds another route with the same structure)
In ROUTES.ts it should not add a trailing / to multiple routes when no reportID is present. This is not needed and not consistent with other URLS.
Before refresh the url is: https://dev.new.expensify.com:8082/request/new/receipt/
After refresh the url is: https://dev.new.expensify.com:8082/request/new/receipt
Note: I was able to reproduce the same double back press behaviour on the MONEY_REQUEST_CONFIRMATION (/request/new/confirmation) route.
The same should be appled to MONEY_REQUEST_CONFIRMATION (/request/new/confirmation) to ensure it does not suffer from the same browser refresh/back button issue.
After reloading the Receipt page, the back button redirects users to the main chat instead of the expected behavior of navigating back to the previous page.
Root Cause
In the EditRequestReceiptPage, the onBackButtonPress function in HeaderWithBackButton does not provide a fallback route. This results in the back button linking to the home page when the route is first in the modal stack after a reload.
Proposed Solutions
Proposal 1
Problem
After reloading the Receipt page, the back button redirects users to the main chat.
Root Cause
In EditRequestReceiptPage.js, the onBackButtonPress in HeaderWithBackButton lacks a fallback route, causing the app to redirect to the main chat after a refresh.
Changes
Set a backTo parameter when navigating to the receipt selector from the money request confirm page. Provide it as a fallback route in goBack to ensure the correct page is linked to when the app is reloaded and the back button is clicked.
Proposal 2
Problem
After reloading on the Receipt page, the back button redirects users to the main chat.
Root Cause
In EditRequestReceiptPage.js, the onBackButtonPress function lacks a fallback route, causing the app to redirect to the main chat after a refresh.
Changes
Create a fallbackRoute variable in EditRequestReceiptPage. Update the onBackButtonPress to include the fallback route, ensuring that after a reload, the back button links to the correct page.
Proposal 3
Problem
The back button does not behave as expected on page refresh on the desktop. It must be pressed twice, and the second press dismisses the Request Money prompt.
Root Cause
The URL changes on refresh, losing the trailing slash and adding another route with the same structure.
There is no fallback route passed on EditRequestReceiptPage's onBackButtonPress.
Changes
In ROUTES.js, add a function to conditionally add the trailing slash to the URL. Apply this to the MONEY_REQUEST_RECEIPT and MONEY_REQUEST_CONFIRMATION routes.
Add the fallbackRoute parameter to EditRequestReceiptPage's onBackButtonPress to ensure proper navigation after a reload.
Alternative Solutions
On browser refresh, close the right-hand panel.
Conclusion
Choose the proposal that best aligns with the codebase and development standards. Ensure that the chosen solution addresses both the reloading issue and the back button behavior. Implement the proposed changes and thoroughly test to guarantee the desired outcomes.
Thanks for raising your concerns, @DylanDylann! I wouldn't worry about the corner case you mentioned. I wouldn't underestimate the user, and they would expect a different behavior if they changed the URL.
@cristipaval@stephanieelliott@thesahindia@ishpaul777 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
I was about to create a PR but it looks the issue is resolved on staging already, using the same change as proposed, by another PR i think we can close @cristipaval@stephanieelliott
Activity
[-]Request Money - After Reloading on Receipt page the back button takes you to main chat[/-][+][$500] Request Money - After Reloading on Receipt page the back button takes you to main chat[/+]melvin-bot commentedon Nov 25, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01845ea13bf2a2f8c4
melvin-bot commentedon Nov 25, 2023
Triggered auto assignment to @stephanieelliott (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Nov 25, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Nov 25, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (
External)ishpaul777 commentedon Nov 25, 2023
Proposal
Problem
After Reloading on Receipt page the back button takes you to main chat
Root Cause
In EditRequestReceiptPage, for
onBackButtonPressin HeaderWithBackButton we we dont provide a fallback route so it just links back to the home when the route is first in the modal stack after reload.Changes
We should set a
backToparam while navigating to the receipt selector from money request confirm page and provide it as fallback route ingoBack,so when app is reloaded and back button links to correct page.Note: using a definte fallback route or setting fallback based on condition is not a good idea when we integrate edit receipt page to some other flow conditions may fail and and component needs a refactor again and i dont think thats a good idea.
DylanDylann commentedon Nov 25, 2023
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/EditRequestReceiptPage.js
Line 50 in d985a0e
we do not pass the fallback route, so after refresh, and then pressing on bac button, the app is just take user to main chat.
What changes do you think we should make in order to solve the problem?
fallbackRoutevariable in EditRequestReceiptPage like below:App/src/pages/EditRequestReceiptPage.js
Line 50 in d985a0e
to:
iou.iouTypeandiou.iouReportIDare used to store the previous iouType and reportID (before refreshing the page). We can update these variable by updating:App/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage.js
Lines 88 to 92 in d985a0e
to:
const navigateToConfirmationStep = (moneyRequestType) => { IOU.setMoneyRequestId(moneyRequestType); IOU.resetMoneyRequestCategory(); IOU.resetMoneyRequestTag(); + IOU.setIouType(moneyRequestType); + IOU.setIouReportID(reportID); Navigation.navigate(ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(moneyRequestType, reportID)); };with
What alternative solutions did you explore? (Optional)
giltron commentedon Nov 25, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The Back button does not behave as expected on page refresh on the desktop. The back button must be pressed twice and the 2nd time pressed it dimisses the Request Money prompt.
What is the root cause of that problem?
There are 2 issues that need to be addressed: 1) The URL changes on refresh, and 2) there is missing fallback route for the onBack
In ROUTES.ts it should not add a trailing
/to multiple routes when no reportID is present. This is not needed and not consistent with other URLS.Before refresh the url is:
https://dev.new.expensify.com:8082/request/new/receipt/After refresh the url is:
https://dev.new.expensify.com:8082/request/new/receiptNote: I was able to reproduce the same double back press behaviour on the MONEY_REQUEST_CONFIRMATION (
/request/new/confirmation) route.Without 1) the same navigation issue happens on the route
request/new/confirmationif you enter the details,What changes do you think we should make in order to solve the problem?
/to the URL:function urlWithSubResource(baseUrl: string, id?: string)So instead of
with result:
/request/new/receipt/It becomes
with result:
/request/new/receiptThe same should be appled to MONEY_REQUEST_CONFIRMATION (
/request/new/confirmation) to ensure it does not suffer from the same browser refresh/back button issue.Alternative Solutions
On browser refresh, close the right hand panel
codeweb05 commentedon Nov 26, 2023
Issue Description
Problem
After reloading the Receipt page, the back button redirects users to the main chat instead of the expected behavior of navigating back to the previous page.
Root Cause
In the
EditRequestReceiptPage, theonBackButtonPressfunction inHeaderWithBackButtondoes not provide a fallback route. This results in the back button linking to the home page when the route is first in the modal stack after a reload.Proposed Solutions
Proposal 1
Problem
After reloading the Receipt page, the back button redirects users to the main chat.
Root Cause
In
EditRequestReceiptPage.js, theonBackButtonPressinHeaderWithBackButtonlacks a fallback route, causing the app to redirect to the main chat after a refresh.Changes
Set a
backToparameter when navigating to the receipt selector from the money request confirm page. Provide it as a fallback route ingoBackto ensure the correct page is linked to when the app is reloaded and the back button is clicked.Proposal 2
Problem
After reloading on the Receipt page, the back button redirects users to the main chat.
Root Cause
In
EditRequestReceiptPage.js, theonBackButtonPressfunction lacks a fallback route, causing the app to redirect to the main chat after a refresh.Changes
Create a
fallbackRoutevariable inEditRequestReceiptPage. Update theonBackButtonPressto include the fallback route, ensuring that after a reload, the back button links to the correct page.Proposal 3
Problem
The back button does not behave as expected on page refresh on the desktop. It must be pressed twice, and the second press dismisses the Request Money prompt.
Root Cause
EditRequestReceiptPage'sonBackButtonPress.Changes
ROUTES.js, add a function to conditionally add the trailing slash to the URL. Apply this to theMONEY_REQUEST_RECEIPTandMONEY_REQUEST_CONFIRMATIONroutes.fallbackRouteparameter toEditRequestReceiptPage'sonBackButtonPressto ensure proper navigation after a reload.Alternative Solutions
Conclusion
Choose the proposal that best aligns with the codebase and development standards. Ensure that the chosen solution addresses both the reloading issue and the back button behavior. Implement the proposed changes and thoroughly test to guarantee the desired outcomes.
14 remaining items
melvin-bot commentedon Dec 6, 2023
❌ There was an error making the offer to @ishpaul777 for the Contributor role. The BZ member will need to manually hire the contributor.
cristipaval commentedon Dec 6, 2023
Thanks for raising your concerns, @DylanDylann! I wouldn't worry about the corner case you mentioned. I wouldn't underestimate the user, and they would expect a different behavior if they changed the URL.
stephanieelliott commentedon Dec 8, 2023
@ishpaul777 I've sent you the offer on Upwork, please accept when you get a chance!
melvin-bot commentedon Dec 9, 2023
@cristipaval @stephanieelliott @thesahindia @ishpaul777 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
ishpaul777 commentedon Dec 11, 2023
I was about to create a PR but it looks the issue is resolved on staging already, using the same change as proposed, by another PR i think we can close @cristipaval @stephanieelliott
cristipaval commentedon Dec 14, 2023
Thanks @ishpaul777!