Skip to content

[Payment due 3/7][$500] Conversation - Back arrow leads to LHN instead of group lists after page refresh in a profile screen #33797

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!


Found when executing PR: #31424

Version Number: v1.4.20-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Team
Slack conversation: @

Action Performed:

  1. Navigate to https://staging.expensify.com/
    and log in
  2. Create a group conversation
  3. Type something
  4. Open group details > members
  5. Open any profile
  6. Refresh the page
  7. Tap on the back button to navigate up to the top of the screen (left side)

Expected Result:

The user should be taken to the group members page instead of LHN.

Actual Result:

After a page refresh, the back button leads the user directly to LHN.

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

Bug6328884_1703904047773.mWeb_-_back_button.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0110014b7fdb5c2a05
  • Upwork Job ID: 1741169400678555648
  • Last Price Increase: 2023-12-30
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 28096418
    • Tony-MK | Contributor | 28096419

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 30, 2023
  2. melvin-bot commented on Dec 30, 2023

    @melvin-bot
  3. changed the title [-]Conversation - Back arrow leads to LHN instead of group lists after page refresh in a profile screen[/-] [+][$500] Conversation - Back arrow leads to LHN instead of group lists after page refresh in a profile screen[/+] on Dec 30, 2023
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 30, 2023
  5. melvin-bot commented on Dec 30, 2023

    @melvin-bot

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

  6. melvin-bot commented on Dec 30, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  7. melvin-bot commented on Dec 30, 2023

    @melvin-bot

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

  8. Tony-MK commented on Dec 30, 2023

    @Tony-MK
    Contributor

    Proposal

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

    The back arrow leads to LHN instead of group lists after the page refreshes in a profile screen.

    What is the root cause of that problem?

    We are not setting any backTo argument in the ReportParticipantsPage

    Navigation.navigate(ROUTES.PROFILE.getRoute(option.accountID));

    Therefore, in the ProfilePage navigateBackTo will take ROUTES.HOME because it is the default when backTo param is not available.

    const navigateBackTo = lodashGet(props.route, 'params.backTo', ROUTES.HOME);

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

    Set backTo to the optional argument in the getRoute function to the current route to the ReportParticipantsPage.

    Navigation.navigate(ROUTES.PROFILE.getRoute(option.accountID, backTo = ROUTES.REPORT_PARTICIPANTS.getRoute(props.report.reportID)));
    
  9. abzokhattab commented on Dec 31, 2023

    @abzokhattab
    Contributor

    Proposal

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

    The back navigation behavior in the participants and profile pages is not working as expected

    What is the root cause of that problem?

    Two issues here:

    1. When a user is on the r/:id/participants page and refreshes the page and clicks the back button, they are not redirected to the report details page. Instead, the modal closes.
      This happens because the HeaderWithBackButton component doesn't have a specified onBackButtonClick behavior, leading to the default behavior of returning the user to the home page.

    2. If a user is on the profile page, and refreshes the page, and then hits back, the modal unexpectedly closes. This is due to the absence of the backTo parameter when routing from the participant's page to the profile page.

      Navigation.navigate(ROUTES.PROFILE.getRoute(option.accountID));

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

    1. Modify the HeaderWithBackButton component in the ReportParticipantsPage to include the onBackButtonClick prop. This change ensures that clicking the back button redirects users to the report details page, rather than closing the modal:
           <HeaderWithBackButton
                            onBackButtonPress={() => Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(props.report.reportID))}
                            title={props.translate(
                                ReportUtils.isChatRoom(props.report) ||
                                    ReportUtils.isPolicyExpenseChat(props.report) ||
                                    ReportUtils.isChatThread(props.report) ||
                                    ReportUtils.isTaskReport(props.report) ||
                                    ReportUtils.isMoneyRequestReport(props.report)
                                    ? 'common.members'
                                    : 'common.details',
                            )}
                        />
    1. To fix the second issue we need to add a BackTo parameter in the navigation from the participant's page to the profile page. This will ensure the back navigation works as expected after a page refresh:
    Navigation.navigate(ROUTES.PROFILE.getRoute(option.accountID, ROUTES.REPORT_PARTICIPANTS.getRoute(props.report.reportID)));

    POC

    Screen.Recording.2023-12-31.at.4.45.45.PM.mov
  10. abzokhattab commented on Dec 31, 2023

    @abzokhattab
    Contributor

    FYI the issue is reproducible on MacOS: Chrome / Safari as well

  11. 30 remaining items

  12. CortneyOfstad commented on Jan 31, 2024

    @CortneyOfstad
    Contributor

    @abdulrahuman5196 any updates on the PR? Thanks!

  13. CortneyOfstad commented on Feb 5, 2024

    @CortneyOfstad
    Contributor
  14. abdulrahuman5196 commented on Feb 5, 2024

    @abdulrahuman5196
    Contributor

    @CortneyOfstad hi, we had some comments on the PR. I need to review the latest version. Will work on reviewing latest version.

  15. CortneyOfstad commented on Feb 6, 2024

    @CortneyOfstad
    Contributor

    Sounds good @abdulrahuman5196 — thanks!

  16. CortneyOfstad commented on Feb 14, 2024

    @CortneyOfstad
    Contributor

    @abdulrahuman5196 just checking in to see where we're at with the comments on the PR — thank you!

  17. abdulrahuman5196 commented on Feb 14, 2024

    @abdulrahuman5196
    Contributor

    Hi @CortneyOfstad . Will close the pending action items in my morning.

  18. CortneyOfstad commented on Feb 22, 2024

    @CortneyOfstad
    Contributor

    @abdulrahuman5196 Any update on the PR? If the pending action has not been completed, do you think that is something that can be done by EOD? Thanks!

  19. abdulrahuman5196 commented on Feb 22, 2024

    @abdulrahuman5196
    Contributor

    @CortneyOfstad The PR has been merged

  20. CortneyOfstad commented on Feb 23, 2024

    @CortneyOfstad
    Contributor

    Thanks @abdulrahuman5196! It shows that is has not launched to staging yet due to on-going QA, so going to keep an eye on this 👍

  21. CortneyOfstad commented on Feb 28, 2024

    @CortneyOfstad
    Contributor

    PR went into staging 2 days ago 👍

  22. CortneyOfstad commented on Feb 29, 2024

    @CortneyOfstad
    Contributor

    @Christinadobrzyn I am going OoO until March 11th, so going to have you keep an eye on this while I am gone if that is okay? Thanks!

  23. abdulrahuman5196 commented on Mar 5, 2024

    @abdulrahuman5196
    Contributor

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

    Doesn't seem to be a regression. Seems to be a bug for sometime.

    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.

    1. Go to the application and log in.
    2. Create a group chat, if none exists.
    3. Go to the group chat.
    4. Open the group details > members list.
    5. Visit a member's profile page and refresh it.
    6. Verify that the same member's profile page is displayed like in step 5.
    7. Tap on the back button.
    8. Verify the app navigated back to the member's list mentioned in step 4.

    @Christinadobrzyn Added bz checklist. This issue should be on payment due for March 7. It seems melvin didn't update automatically

  24. changed the title [-][$500] Conversation - Back arrow leads to LHN instead of group lists after page refresh in a profile screen[/-] [+][Payment due 3/7][$500] Conversation - Back arrow leads to LHN instead of group lists after page refresh in a profile screen[/+] on Mar 7, 2024
  25. Christinadobrzyn commented on Mar 7, 2024

    @Christinadobrzyn
    Contributor

    Thanks @abdulrahuman5196!

    Payouts due:

    Contributor: $500 @Tony-MK (paid in Upwork - https://www.upwork.com/nx/wm/offer/28096419
    Contributor+: $500 @abdulrahuman5196 (paid in Upwork - https://www.upwork.com/nx/wm/offer/28096418)

    Upwork job is here.

    Regression test - https://github.com/Expensify/Expensify/issues/376315

    I think this is good to close - let me know otherwise!

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 contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions