Skip to content

[HOLD for payment 2024-10-22] [$250] Book travel - Report screen changes to profile view when clicking Country field #50155

Closed

Description

@IuliiaHerets

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: 9.0.44-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+kh0110001@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Book travel.
  3. Click Book travel.
  4. Click Country.

Expected Result:

The report screen in the background will not change to profile page.

Actual Result:

The report screen in the background changes to profile page while LHN remains the same after opening Country RHP.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6623236_1727962477743.20241003_211113.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021843246313566765560
  • Upwork Job ID: 1843246313566765560
  • Last Price Increase: 2024-10-07
  • Automatic offers:
    • dukenv0307 | Contributor | 104317443
Issue OwnerCurrent Issue Owner: @trjExpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 3, 2024
  2. melvin-bot commented on Oct 3, 2024

    @melvin-bot

    Triggered auto assignment to @trjExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. IuliiaHerets commented on Oct 3, 2024

    @IuliiaHerets
    Author

    We think that this bug might be related to #vip-travel

  4. IuliiaHerets commented on Oct 3, 2024

    @IuliiaHerets
    Author

    @trjExpensify FYI 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

  5. bernhardoj commented on Oct 3, 2024

    @bernhardoj
    Contributor

    Proposal

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

    Report screen changes to profile screen when open the Country page from the book travel page.

    What is the root cause of that problem?

    By default, the address country RHP maps to the profile screen.

    [SCREENS.SETTINGS.PROFILE.ROOT]: [
    SCREENS.SETTINGS.PROFILE.DISPLAY_NAME,
    SCREENS.SETTINGS.PROFILE.CONTACT_METHODS,
    SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_DETAILS,
    SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_VALIDATE_ACTION,
    SCREENS.SETTINGS.PROFILE.NEW_CONTACT_METHOD,
    SCREENS.SETTINGS.PROFILE.STATUS_CLEAR_AFTER,
    SCREENS.SETTINGS.PROFILE.STATUS_CLEAR_AFTER_DATE,
    SCREENS.SETTINGS.PROFILE.STATUS_CLEAR_AFTER_TIME,
    SCREENS.SETTINGS.PROFILE.STATUS,
    SCREENS.SETTINGS.PROFILE.PRONOUNS,
    SCREENS.SETTINGS.PROFILE.TIMEZONE,
    SCREENS.SETTINGS.PROFILE.TIMEZONE_SELECT,
    SCREENS.SETTINGS.PROFILE.LEGAL_NAME,
    SCREENS.SETTINGS.PROFILE.DATE_OF_BIRTH,
    SCREENS.SETTINGS.PROFILE.ADDRESS,
    SCREENS.SETTINGS.PROFILE.ADDRESS_COUNTRY,

    But we have a logic to find the matching central pane screen based on the backTo params.

    if (route.params && 'backTo' in route.params && typeof route.params.backTo === 'string') {
    const stateForBackTo = getStateFromPath(route.params.backTo, config);
    if (stateForBackTo) {
    // If there is rhpNavigator in the state generated for backTo url, we want to get root route matching to this rhp screen.
    const rhpNavigator = stateForBackTo.routes.find((rt) => rt.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR);
    if (rhpNavigator && rhpNavigator.state) {
    const isRHPinState = stateForBackTo.routes.at(0)?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR;
    if (isRHPinState) {
    return getMatchingRootRouteForRHPRoute(findFocusedRoute(stateForBackTo) as NavigationPartialRoute);
    }
    }
    // If we know that backTo targets the root route (full screen) we want to use it.
    const fullScreenNavigator = stateForBackTo.routes.find((rt) => rt.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR);
    if (fullScreenNavigator && fullScreenNavigator.state) {
    return fullScreenNavigator as NavigationPartialRoute<CentralPaneName | typeof NAVIGATORS.FULL_SCREEN_NAVIGATOR>;
    }
    // If we know that backTo targets a central pane screen we want to use it.
    const centralPaneScreen = stateForBackTo.routes.find((rt) => isCentralPaneName(rt.name));
    if (centralPaneScreen) {
    return centralPaneScreen as NavigationPartialRoute<CentralPaneName | typeof NAVIGATORS.FULL_SCREEN_NAVIGATOR>;
    }
    }
    }

    In our case, the last backTo param is the travel page which doesn't have a central pane screen mapping, which will later be defaulted to the report screen.

    matchingRootRoute = matchingRootRoute ?? (!isNarrowLayout ? {name: SCREENS.REPORT} : undefined);

    However, the result is ignored because of isRHPinState is false here.

    if (rhpNavigator && rhpNavigator.state) {
    const isRHPinState = stateForBackTo.routes.at(0)?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR;
    if (isRHPinState) {
    return getMatchingRootRouteForRHPRoute(findFocusedRoute(stateForBackTo) as NavigationPartialRoute);
    }
    }

    It's because stateForBackTo.routes contains [BottomTabNavigator, RHPNavigator], so always accessing the first index won't work. We can just remove isRHPinState because we already have rhpNavigator which already finds RHP inside stateForBackTo.routes.

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

    Remove the isRHPInState. We previously fixed this before, but the isRHPinState is reintroduced in #49534, specifically this changes. I believe it's a bad merge.

  6. trjExpensify commented on Oct 7, 2024

    @trjExpensify
    Contributor

    Filing this one under vip-travel. CC: @stitesExpensify

  7. moved this to Medium - Fall '24 (Nov ?) in [#whatsnext] #Travelon Oct 7, 2024
  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 7, 2024
  9. changed the title [-]Book travel - Report screen changes to profile view when clicking Country field[/-] [+][$250] Book travel - Report screen changes to profile view when clicking Country field[/+] on Oct 7, 2024
  10. melvin-bot commented on Oct 7, 2024

    @melvin-bot
  11. 26 remaining items

  12. dukenv0307 commented on Oct 22, 2024

    @dukenv0307
    Contributor

    BugZero Checklist:

    • The PR that introduced the bug has been identified. Link to the PR: Add prefer-at condition to eslint #49534
    • 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/49534/files#r1815522422
    • 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. Yes
    • 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.

    Regression test:

    1. Press FAB > Book Travel
    2. Press Book travel
    3. Press Country
    4. (Web/Desktop) Verify the report screen behind RHP doesn't change
    5. (small screen) Close the book travel page
    6. (small screen) Verify you are still at LHN

    Do we 👍 or 👎

  13. rlinoz commented on Oct 23, 2024

    @rlinoz
    Contributor

    Personally I think that is a very odd test to have, I think we don't need one for this bug.

  14. trjExpensify commented on Oct 23, 2024

    @trjExpensify
    Contributor

    Standalone as a test, I agree. But in some wider regression test about Book travel, having a one liner added doesn't sound so bad.

    The PR that introduced the bug has been identified. Link to the PR: N/A
    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: N/A

    @dukenv0307 can you provide context behind these "N/A"'s please?

  15. dukenv0307 commented on Oct 24, 2024

    @dukenv0307
    Contributor

    @trjExpensify Sorry I missed adding the links. I updated the checklists

  16. trjExpensify commented on Oct 24, 2024

    @trjExpensify
    Contributor

    Thanks! Confirming the payment summary as follows:

    Closing!

  17. moved this from Future - NewDot to Done in [#whatsnext] #Travelon Oct 24, 2024
  18. melvin-bot commented on Oct 24, 2024

    @melvin-bot

    @rlinoz @trjExpensify Be sure to fill out the Contact List!

  19. trjExpensify commented on Oct 24, 2024

    @trjExpensify
    Contributor

    ^^ @mallenexpensify what is this?

  20. bernhardoj commented on Oct 25, 2024

    @bernhardoj
    Contributor

    Requested in ND.

  21. JmillsExpensify commented on Oct 25, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  22. mallenexpensify commented on Oct 25, 2024

    @mallenexpensify
    Contributor

    @trjExpensify posted about in #bug-zero here

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions