Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$500] Web - Settings - reload on set status closes RHN on back #33002

Closed
3 of 6 tasks
kbecciv opened this issue Dec 13, 2023 · 14 comments
Closed
3 of 6 tasks

[$500] Web - Settings - reload on set status closes RHN on back #33002

kbecciv opened this issue Dec 13, 2023 · 14 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Dec 13, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v1.4.12-0
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:

  1. Open the app
  2. Open settings->profile->status->status
  3. Reload on the page
  4. Click on back twice and observe that instead of opening profile page, it closes RHN

Expected Result:

App should open profile page on click on back on status page

Actual Result:

On reload on set status page and back twice, app closes RHN instead of opening profile page

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6311905_1702485009367.windows_chrome_-_reload_on_set_status_closes_RHN_on_back.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0170b01de1f11ae942
  • Upwork Job ID: 1735019080921497600
  • Last Price Increase: 2023-12-27
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 13, 2023
@melvin-bot melvin-bot bot changed the title Web - Settings - reload on set status closes RHN on back [$500] Web - Settings - reload on set status closes RHN on back Dec 13, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

Triggered auto assignment to @slafortune (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

Copy link

melvin-bot bot commented Dec 13, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0170b01de1f11ae942

Copy link

melvin-bot bot commented Dec 13, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 13, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External)

@yh-0218
Copy link
Contributor

yh-0218 commented Dec 13, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Web - Settings - reload on set status closes RHN on back

What is the root cause of that problem?

const navigateBackToSettingsPage = useCallback(() => {

we are now back to topMostReportID.

What changes do you think we should make in order to solve the problem?

we can use only this.

 Navigation.goBack(ROUTES.SETTINGS_PROFILE, false, true);

What alternative solutions did you explore? (Optional)

@DylanDylann
Copy link
Contributor

DylanDylann commented Dec 14, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

  • Web - Settings - reload on set status closes RHN on back

What is the root cause of that problem?

   const navigateBackToSettingsPage = useCallback(() => {
        const topMostReportID = Navigation.getTopmostReportId();
        if (topMostReportID) {
            Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(topMostReportID));
        } else {
            Navigation.goBack(ROUTES.SETTINGS_PROFILE, false, true);
        }
    }, []);
  • So, because the bug is reported in staging env, I will do the RCA with the above code.
  • The RCA is that, when we refresh the page, then click back button, Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(topMostReportID)); is called
  • Then, in the Navigation.goback function, the logic bellow is called:
    if (shouldEnforceFallback || (isFirstRouteInNavigator && fallbackRoute)) {
    navigate(fallbackRoute, CONST.NAVIGATION.TYPE.UP);
    return;
    }
  • That leads to the behavior: RHN is closed

What changes do you think we should make in order to solve the problem?

  • Also, we can use the backTo params, that will store the previous screen to the URL params, and based on it, we know which screen we should navigate to after clicking on back button. Do it by the following main steps:
  1. Update:
    SETTINGS_STATUS: 'settings/profile/status',

    to:
  SETTINGS_STATUS: {route: 'settings/profile/status', getRoute: (backTo?: string) => getUrlWithBackToParam('settings/profile/status', backTo)},
  1. Update:
    Navigation.setShouldPopAllStateOnUP();
    Navigation.navigate(ROUTES.SETTINGS_STATUS);

    to:
        const activeRoute = Navigation.getActiveRouteWithoutParams();
        Navigation.navigate(ROUTES.SETTINGS_STATUS.getRoute(activeRoute));
  1. Finally, update the navigateBackToPreviousScreen to:
    const navigateBackToPreviousScreen = useCallback(() => {
        const backTo = lodashGet(route, 'params.backTo', '');
        Navigation.goBack(backTo || ROUTES.SETTINGS_PROFILE);
    }, [route]);

What alternative solutions did you explore? (Optional)

  • First, we need to revert the change that was removed.
  • We can export the shouldPopAllStateOnUP - which Inform the navigation that next time user presses UP we should pop all the state back to LHN
  • Then, update the above navigateBackToSettingsPage to:
    const navigateBackToPreviousScreen = useCallback(() => {
        const topMostReportID = Navigation.getTopmostReportId();
+      const shouldPopAllStateOnUP = Navigation.getShouldPopAllStateOnUP();
+        if (shouldPopAllStateOnUP && topMostReportID) {
            Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(topMostReportID));
        } else {
            Navigation.goBack(ROUTES.SETTINGS_PROFILE, false, true);
        }
    }, []);

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@abdulrahuman5196
Copy link
Contributor

Hi, Will review today.

Copy link

melvin-bot bot commented Dec 20, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@abdulrahuman5196
Copy link
Contributor

Reviewing now

@melvin-bot melvin-bot bot removed the Overdue label Dec 20, 2023
@abdulrahuman5196
Copy link
Contributor

@slafortune

I am seeing a different flow in current staging, am I need to be in some beta to be able to see the flow mentioned in the bug?

Screen.Recording.2023-12-20.at.11.11.33.PM.mov

@melvin-bot melvin-bot bot added the Overdue label Dec 25, 2023
@abdulrahuman5196
Copy link
Contributor

Waiting on @slafortune here #33002 (comment).
I think folks are off this week. So could expect delay in responses.

@melvin-bot melvin-bot bot removed the Overdue label Dec 25, 2023
Copy link

melvin-bot bot commented Dec 27, 2023

@slafortune @abdulrahuman5196 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!

@melvin-bot melvin-bot bot added the Overdue label Dec 27, 2023
Copy link

melvin-bot bot commented Dec 27, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@slafortune
Copy link
Contributor

Actually @abdulrahuman5196 I'm not able to reproduce this again now either!

@melvin-bot melvin-bot bot removed the Overdue label Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

5 participants