Skip to content

[$250] Navigation - Navigating back from Group Name page takes you to settings #45812

Closed

Description

@lanitochka17

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.9-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: N/A
Email or phone of affected tester (no customers): dave0123seife@gmail.com
Issue reported by: Applause -Internal Team

Action Performed:

  1. Create a group chat
  2. Click on group chat header > Group Name
  3. Refresh page
  4. Click the back button on top

Expected Result:

Navigated back to the details page

Actual Result:

Navigated from group name page to the Settings 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

Bug6547424_1721412169164.Issue_Group_Name_Navigation.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0161510c9ca070bc11
  • Upwork Job ID: 1816208685407209961
  • Last Price Increase: 2024-07-24
  • Automatic offers:
    • nyomanjyotisa | Contributor | 103342040
Issue OwnerCurrent Issue Owner: @puneetlath

Activity

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

    @melvin-bot

    Triggered auto assignment to @MitchExpensify (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. nyomanjyotisa commented on Jul 20, 2024

    @nyomanjyotisa
    Member

    Proposal

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

    Navigating back from Group Name page takes you to settings

    What is the root cause of that problem?

    It will always navigate to REPORT_SETTINGS on back button press after refresh page if isUpdatingExistingReport is true due to this code:

    <HeaderWithBackButton
    title={translate('groupConfirmPage.groupName')}
    onBackButtonPress={() => Navigation.goBack(isUpdatingExistingReport ? ROUTES.REPORT_SETTINGS.getRoute(reportID) : ROUTES.NEW_CHAT_CONFIRM)}
    />

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

    Update that code to navigate to the report detail page on back button press after refresh page

    onBackButtonPress={() => Navigation.goBack(isUpdatingExistingReport ? ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID) : ROUTES.NEW_CHAT_CONFIRM)}
    

    RESULT

    -2-New-Expensify.2.mp4

    What alternative solutions did you explore? (Optional)

  4. tienifr commented on Jul 20, 2024

    @tienifr
    Contributor

    Proposal

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

    • Navigated from group name page to the Settings page

    What is the root cause of that problem?

    • The back button works properly if we do not refreshing the page though we use Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(reportID)). It is because:
    • When we click on header, the screen stack is:
    [
     ...
        {
            "name": "RightModalNavigator",
            "state": {
                "index": 0,
                "routes": [
                    {
                        "name": "Report_Details",
                        "state": {
                            "index": 0,
                            "routes": [
                                {
                                    "name": "Report_Details_Root"
                                }
                            ]
                        }
                    }
                ]
            }
        }
    ]
    
    
    • Then click on report name, the screen stack is:
    [
     ...
        {
            "name": "RightModalNavigator",
            "state": {
                "index": 1,
                "routes": [
                    {
                        "name": "Report_Details",
                        "state": {
                            "index": 0,
                            "routes": [
                                {
                                    "name": "Report_Details_Root"
                                }
                            ]
                        }
                    },
                    {
                        "name": "Report_Settings",
                        "state": {
                            "index": 0,
                            "routes": [
                                {
                                    "name": "Report_Settings_Name"
                                }
                            ]
                        }
                    }
                ]
            }
        }
    ]
    
    • Now if we click on back button, this logic is called:

      if ((lastRoute?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR || lastRoute?.name === NAVIGATORS.LEFT_MODAL_NAVIGATOR) && (lastRoute.state?.index ?? 0) > 0) {
      navigationRef.current.goBack();
      return;
      }

      then the Report_Details_Root is displayed as expected.

    • In case of the bug, when we open Report_Settings_Name page then refreshing, the screen stack is:

    [
    ...
        {
            "name": "RightModalNavigator",
            "state": {
                "index": 0,
                "routes": [
                    {
                        "name": "Report_Settings",
                        "state": {
                            "index": 0,
                            "routes": [
                                {
                                    "name": "Report_Settings_Name"
                                }
                            ]
                        }
                    }
                ]
            }
        }
    ]
    
    • Now, if we click on back button, this logic is called:
      if (shouldEnforceFallback || (isFirstRouteInNavigator && fallbackRoute)) {
      navigate(fallbackRoute, CONST.NAVIGATION.TYPE.UP);
      return;
      }

      then the Report_Settings_Name is replaced by Report_Settings_Root. Here is the bug 's behavior.

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

    • We need to use Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID)) instead to make sure, in the 2nd case in my RCA section, the Report_Settings_Name is replaced by Report_Details_Root, not Report_Settings_Root. Create a go back function:
        const goBack = useCallback(() => Navigation.goBack(isUpdatingExistingReport ? ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID) : ROUTES.NEW_CHAT_CONFIRM), [isUpdatingExistingReport, reportID]);
    

    and use it in here, here and here.

  5. removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 22, 2024
  6. removed their assignment
    on Jul 22, 2024
  7. melvin-bot commented on Jul 22, 2024

    @melvin-bot

    Triggered auto assignment to @puneetlath (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.

  8. 17 remaining items

  9. melvin-bot commented on Jul 31, 2024

    @melvin-bot

    📣 @nyomanjyotisa 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

    Offer link
    Upwork job
    Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
    Keep in mind: Code of Conduct | Contributing 📖

  10. melvin-bot commented on Aug 3, 2024

    @melvin-bot

    @puneetlath @eVoloshchak @nyomanjyotisa 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!

  11. melvin-bot commented on Aug 28, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. @puneetlath, @eVoloshchak, @nyomanjyotisa eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  12. puneetlath commented on Aug 28, 2024

    @puneetlath
    Contributor

    Looks like this is ready to pay.

    I've paid @nyomanjyotisa. @eVoloshchak can you do the checklist?

  13. eVoloshchak commented on Sep 2, 2024

    @eVoloshchak
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: [Group Chats] Add remaining features #39757
    • 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/39757/files#r1741062297
    • 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: this is a pretty straightforward issue, I don't think an additional discussion is needed

    Regression Test Proposal

    1. Create a group chat
    2. Click on group the chat header > Group Name
    3. Refresh the page
    4. Click the back button on top
    5. Verify that you're navigated back to the details page

    Do we agree 👍 or 👎

  14. puneetlath commented on Sep 3, 2024

    @puneetlath
    Contributor

    Payment summary:

    Thanks everyone!

  15. JmillsExpensify commented on Sep 5, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @eVoloshchak

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorMonthlyKSv2ReviewingHas a PR in review

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions