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

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

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 20, 2024 · 17 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 20, 2024

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: 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): [email protected]
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
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 20, 2024
Copy link

melvin-bot bot commented Jul 20, 2024

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.

@nyomanjyotisa
Copy link
Contributor

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)

@tienifr
Copy link
Contributor

tienifr commented Jul 20, 2024

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.

@melvin-bot melvin-bot bot added the Overdue label Jul 22, 2024
@MitchExpensify MitchExpensify removed the Bug Something is broken. Auto assigns a BugZero manager. label Jul 22, 2024
@MitchExpensify MitchExpensify removed their assignment Jul 22, 2024
@melvin-bot melvin-bot bot removed the Overdue label Jul 22, 2024
@MitchExpensify MitchExpensify added Overdue Bug Something is broken. Auto assigns a BugZero manager. labels Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

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.

@melvin-bot melvin-bot bot removed the Overdue label Jul 22, 2024
@MitchExpensify
Copy link
Contributor

I am on parental leave, reassigning

@melvin-bot melvin-bot bot added the Overdue label Jul 24, 2024
@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Jul 24, 2024
Copy link

melvin-bot bot commented Jul 24, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0161510c9ca070bc11

@melvin-bot melvin-bot bot changed the title Navigation - Navigating back from Group Name page takes you to settings [$250] Navigation - Navigating back from Group Name page takes you to settings Jul 24, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 24, 2024
Copy link

melvin-bot bot commented Jul 24, 2024

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

Copy link

melvin-bot bot commented Jul 30, 2024

@puneetlath, @eVoloshchak Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Jul 30, 2024
@eVoloshchak
Copy link
Contributor

@nyomanjyotisa's proposal looks good to me!

🎀👀🎀 C+ reviewed!

@melvin-bot melvin-bot bot removed the Overdue label Jul 30, 2024
Copy link

melvin-bot bot commented Jul 30, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

📣 @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 📖

Copy link

melvin-bot bot commented Aug 3, 2024

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

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Overdue labels Aug 5, 2024
@melvin-bot melvin-bot bot removed the Weekly KSv2 label Aug 28, 2024
Copy link

melvin-bot bot commented Aug 28, 2024

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!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Aug 28, 2024
@puneetlath
Copy link
Contributor

Looks like this is ready to pay.

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

@eVoloshchak
Copy link
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 👎

@puneetlath
Copy link
Contributor

Payment summary:

Thanks everyone!

@JmillsExpensify
Copy link

$250 approved for @eVoloshchak

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. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
No open projects
Status: No status
Development

No branches or pull requests

7 participants