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

[HOLD for payment 2024-04-25] [$500] Back to home leads to recent chat instead of LHN after opening non-existing profile #38390

Closed
2 of 6 tasks
izarutskaya opened this issue Mar 15, 2024 · 28 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Mar 15, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v1.4.52-5
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4424104
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Log in to New Expensify
  2. Navigate to non-existing profile, e. g. https://staging.new.expensify.com/a/hello
  3. Tap on Go back to home page
  4. Tap on Go back to home page again

Expected Result:

User should be redirected back to LHN

Actual Result:

User is redirected to the most recent chat instead of LHN.
Hmm.. it's not here page is displayed twice.

Partially reproducible in Prod:
User is also redirected to the most recent chat instead of LHN, but not here page is shown once.

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

Bug6414170_1710450722340.Record_2024-03-14-21-21-17.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d8b170d82d50a998
  • Upwork Job ID: 1775265846262415360
  • Last Price Increase: 2024-04-02
  • Automatic offers:
    • ishpaul777 | Reviewer | 0
    • bernhardoj | Contributor | 0
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 15, 2024
Copy link

melvin-bot bot commented Mar 15, 2024

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

@izarutskaya
Copy link
Author

@anmurali I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@izarutskaya
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1
CC @trjExpensify

@bernhardoj
Copy link
Contributor

Proposal

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

The most recent chat is shown when going back from not found profile page.

What is the root cause of that problem?

When we open an RHP page, in this case, the profile page, it will try to find the matching bottom tab, matching central pane screen, and the RHP itself and "push" them all to the stack.

if (rhpNavigator) {
// Routes
// - matching bottom tab
// - matching root route for rhp
// - found rhp

To find the matching central pane, it will check the mapping here,

// Check for CentralPaneNavigator
for (const [centralPaneName, RHPNames] of Object.entries(CENTRAL_PANE_TO_RHP_MAPPING)) {
if (RHPNames.includes(route.name)) {
return createCentralPaneNavigator({name: centralPaneName as CentralPaneName, params: route.params});
}
}
// Check for FullScreenNavigator
for (const [fullScreenName, RHPNames] of Object.entries(FULL_SCREEN_TO_RHP_MAPPING)) {
if (RHPNames && RHPNames.includes(route.name)) {
return createFullScreenNavigator({name: fullScreenName as FullScreenName, params: route.params});
}
}

but in our case, a profile page doesn't have any mapping. We can't map a profile page to any central pane. Because the matching central pane is undefined, we use a default one and that is a report screen without any reportID which will find the most recent report to show.

matchingRootRoute = matchingRootRoute ?? createCentralPaneNavigator({name: SCREENS.REPORT});

So, when we press back, we will see the most recent report chat.

This is useful for desktop view since a central pane screen is always visible, but it's not for a small screen.

I can't reproduce the app navigates back to the not found page on dev (only on staging, maybe fixed).

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

For a small screen, if there is no matching central pane, we shouldn't push the default, that is the report screen to the navigation.

matchingRootRoute = matchingRootRoute ?? (!isNarrowLayout ? createCentralPaneNavigator({name: SCREENS.REPORT}) : undefined);
...
const matchingBottomTabRoute = getMatchingBottomTabRouteForState(matchingRootRoute ? {routes: [matchingRootRoute]} : {routes: []});
...
if (matchingRootRoute && (!isNarrowLayout || !isRHPScreenOpenedFromLHN)) {
    routes.push(matchingRootRoute);
}

@dragnoir
Copy link
Contributor

Proposal

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

Profile page, back to home leads to recent chat instead of LHN

What is the root cause of that problem?

We are not setting the value of onLinkPress to FullPageNotFoundView in ProfilePage

<FullPageNotFoundView shouldShow={shouldShowBlockingView || CONST.RESTRICTED_ACCOUNT_IDS.includes(accountID)}>

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

set onLinkPress value to navigate to LHN when clicked.

<FullPageNotFoundView
                shouldShow={shouldShowBlockingView || CONST.RESTRICTED_ACCOUNT_IDS.includes(accountID)}
                onLinkPress={() => {
                    Navigation.goBack(ROUTES.HOME);
                }}
            >

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Mar 18, 2024
Copy link

melvin-bot bot commented Mar 18, 2024

@anmurali Whoops! This issue is 2 days overdue. Let's get this updated quick!

@anmurali anmurali added the Needs Reproduction Reproducible steps needed label Mar 18, 2024
@anmurali
Copy link

I cannot reproduce on Staging or Production. I see the Go back to home page once and it successfully takes me back to LHN

@melvin-bot melvin-bot bot removed the Overdue label Mar 18, 2024
@bernhardoj
Copy link
Contributor

@anmurali hi, it's still reproducible, can you recheck, please?

Screen.Recording.2024-03-19.at.13.31.36.mov

Notice that it goes back to report/chat screen instead of LHN.

@lanitochka17
Copy link

Issue is still reproducible on the latest build 1.4.57-2

0-02-01-5f68f73f9a6f56b253929cf49e651111cdb66963ca6c38c5370a4088f55ebe5c_f9f3703862c082fc.mp4
Record_2024-03-27-20-51-50.mp4

@lanitochka17 lanitochka17 reopened this Mar 27, 2024
@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
@anmurali
Copy link

anmurali commented Apr 2, 2024

Ah I see in mWeb what you mean. I missed that.

@melvin-bot melvin-bot bot removed the Overdue label Apr 2, 2024
@anmurali anmurali added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Apr 2, 2024
@melvin-bot melvin-bot bot changed the title Back to home leads to recent chat instead of LHN after opening non-existing profile [$500] Back to home leads to recent chat instead of LHN after opening non-existing profile Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01d8b170d82d50a998

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

@ishpaul777
Copy link
Contributor

reviewing 👀

@ishpaul777
Copy link
Contributor

@bernhardoj RCA makes most sense to me and the solution also works well! Their proposal looks good to me!

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Apr 6, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @ishpaul777

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 18, 2024
@melvin-bot melvin-bot bot changed the title [$500] Back to home leads to recent chat instead of LHN after opening non-existing profile [HOLD for payment 2024-04-25] [$500] Back to home leads to recent chat instead of LHN after opening non-existing profile Apr 18, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Apr 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.62-17 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 2024-04-25. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Apr 18, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@ishpaul777] The PR that introduced the bug has been identified. Link to the PR:
  • [@ishpaul777] 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:
  • [@ishpaul777] A discussion in #expensify-bugs 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:
  • [@ishpaul777] Determine if we should create a regression test for this bug.
  • [@ishpaul777] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@anmurali] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@anmurali
Copy link

@bernhardoj is paid. @ishpaul777 can you complete the checklist so I can release your payment as well?

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Apr 24, 2024
@deetergp
Copy link
Contributor

Bump @ishpaul777

@melvin-bot melvin-bot bot removed the Overdue label Apr 28, 2024
@ishpaul777
Copy link
Contributor

ishpaul777 commented Apr 29, 2024

The PR that introduced the bug has been identified. Link to the PR: #37421

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/37421/files#r1582555183

A discussion in #expensify-bugs 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: N/A

Determine if we should create a regression test for this bug. - I dont think so.

If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. - Incase we do need one, steps to repro and expected result in OP looks good!

@ishpaul777
Copy link
Contributor

Sorry for delay completed checklist!

@melvin-bot melvin-bot bot added the Overdue label May 1, 2024
@deetergp
Copy link
Contributor

deetergp commented May 1, 2024

Woo! Thanks @ishpaul777. All you @anmurali 🎉

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 1, 2024
@ishpaul777
Copy link
Contributor

gentle bump @anmurali 😄

@melvin-bot melvin-bot bot removed the Overdue label May 6, 2024
@anmurali
Copy link

anmurali commented May 6, 2024

completed all payments!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Archived in project
Development

No branches or pull requests

7 participants