Closed kbecciv closed 1 year ago
Triggered auto assignment to @johncschuster (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)The problem we are aiming to address in this issue is that when users attempt to exit the split bill flow from the money request confirm page by clicking the back button, they find themselves unable to leave the split bill flow.
The root cause of this issue lies in the code within MoneyRequestModal.js
. Specifically, the following code:
const navigateBack = isEditingAmountAfterConfirm ? () => navigateToStep(moneyRequestStepIndex) : navigateToPreviousStep;
prevents users from exiting the split bill flow if they click the back button multiple times from the confirm page.
To resolve this problem, I recommend making the following changes in MoneyRequestModal.js
:
if (currentStepIndex === _.indexOf(steps, Steps.MoneyRequestConfirm)) {
Navigation.dismissModal();
}
By including this code snippet within the navigateToPreviousStep
function, we enable users to successfully exit the split bill flow from the confirm page by clicking the back button.
None
https://github.com/Expensify/App/assets/2527288/cf5e9924-cd08-4dff-83a0-3c58dbcdebdf
Looks like something related to react-navigation
may have been mentioned in this issue discussion.
As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js
files should not be accepted.
Feel free to drop a note in #expensify-open-source with any questions.
Split Bill - Incorrect back button functionality doesn't allow to cancel Split Bill in the group
Here in navigateToPreviousStep
https://github.com/Expensify/App/blob/20f6ae7dab6cee8c537e491e64ece59163e209af/src/pages/iou/MoneyRequestModal.js#L207-L219
we call
setPreviousStepIndex(currentStepIndex);
setCurrentStepIndex(currentStepIndex - 1);
so if we in step 1 and user click back, the result will be current = 0; prev = 1
(note prev is larger than current);
previousStepIndex = 1;
setCurrentStepIndex = 0;
This is cause infinite loop, the result should be current = 0; prev = -1
;
The navigateToPreviousStep
should be:
if click back when step = 0; close modal;
if click back when step = 1; currentStep = 0; and prevStep = -1;
if click back when step = 2; currentStep = 1; and prevStep = 0;
so the fix should be
setPreviousStepIndex(currentStepIndex);
setPreviousStepIndex(currentStepIndex - 2); // <<<<<<<<<<<<<<<<<<<<<
setCurrentStepIndex(currentStepIndex - 1);
We are refactoring money request page here and it's a dupe of https://github.com/Expensify/App/issues/17637
@johncschuster Eep! 4 days overdue now. Issues have feelings too...
@bernhardoj Thanks for calling out that this is a duplicate! I didn't think to use the keywords, "infinite loop" to locate a previously created issue.
Would you say we can close this issue then?
Yes, I think we can close this one
Thanks! Doing it.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
User can exit Split Bill flow
Actual Result:
User is blocked within Split Bill flow
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.27.4
Reproducible in staging?: yes
Reproducible in production?:yes
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
Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/93399543/7a66adae-f046-4071-a108-14cfbb4216eb
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub