Skip to content

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

Closed

Description

@izarutskaya

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

Activity

  1. added
    Daily
    Bug
    on Mar 15, 2024
  2. melvin-bot commented on Mar 15, 2024

    @melvin-bot

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

  3. izarutskaya commented on Mar 15, 2024

    @izarutskaya
    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.

  4. izarutskaya commented on Mar 15, 2024

    @izarutskaya
    Author

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

  5. bernhardoj commented on Mar 15, 2024

    @bernhardoj
    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);
    }
    
  6. dragnoir commented on Mar 15, 2024

    @dragnoir
    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)

  7. melvin-bot commented on Mar 18, 2024

    @melvin-bot

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

  8. added
    Needs Reproduction
    on Mar 18, 2024
  9. anmurali commented on Mar 18, 2024

    @anmurali

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

  10. bernhardoj commented on Mar 19, 2024

    @bernhardoj
    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.

  11. 34 remaining items

  12. added
    Daily
    and removed
    Weekly
    on Apr 24, 2024
  13. deetergp commented on Apr 28, 2024

    @deetergp
    Contributor
  14. ishpaul777 commented on Apr 29, 2024

    @ishpaul777
    Contributor

    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!

  15. ishpaul777 commented on Apr 29, 2024

    @ishpaul777
    Contributor

    Sorry for delay completed checklist!

  16. deetergp commented on May 1, 2024

    @deetergp
    Contributor

    Woo! Thanks @ishpaul777. All you @anmurali 🎉

  17. ishpaul777 commented on May 6, 2024

    @ishpaul777
    Contributor

    gentle bump @anmurali 😄

  18. anmurali commented on May 6, 2024

    @anmurali

    completed all payments!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions