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

[HOLD for payment 2023-09-27] [$1000] Clicking back button takes user to LHN instead of previous page #23758

Closed
1 of 6 tasks
kavimuru opened this issue Jul 27, 2023 · 53 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Jul 27, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Create a workspace
  2. Open announce room
  3. Click on header
  4. Click on workspace name to go to workspace settings
  5. Click on three dots > Go to admin room
  6. Click on back button at the top left corner
  7. Click on three dots > Go to announce room
  8. Click on back button

Expected Result:

App should take user back to workspace settings page just as it does on step 6

Actual Result:

The app takes users back to the LHN if the user went to the workspace settings page through a specific room (let's say the "Admin Room") and then click the back button, it takes them directly to the LHN. Similarly, if users navigate to the workspace settings page from "Announce Room" header then went back to the announce room through the three dots menu and then click the back button, they are also redirected to the LHN. But if user came from the announce room header to the workspace settings > clicked three dots > then went to the admin room and clicked the back button the app takes user back to the workspace settings page.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.46-1
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
Notes/Photos/Videos: Any additional supporting documentation

Screen_Recording_20230727_094617_New.Expensify.mp4
az_recorder_20230727_155539.2.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Nathan-Mulugeta
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690441099091969

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019b545eb8a3cbf0e4
  • Upwork Job ID: 1688659311957544960
  • Last Price Increase: 2023-08-29
  • Automatic offers:
    • bernhardoj | Contributor | 26489581
    • nathan-mulugeta | Reporter | 26489582
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 27, 2023

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

@ygshbht
Copy link
Contributor

ygshbht commented Jul 28, 2023

Proposal

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

The app's current navigation behavior takes the user to the Left Hand Navigation (LHN) when the back button is clicked, after moving to a specific room from the workspace settings page. The expected behavior is to navigate the user back to the previous page, the workspace settings in this case.

What is the root cause of that problem?

The React Navigation library, which we use for handling navigation in the app, navigates back to an existing screen if it already exists in the stack when an action of type NAVIGATE is fired. This behavior is inconsistent with our app's user flow in this instance, causing the user to be directed to the LHN instead of the workspace settings page.

if (action.type === 'NAVIGATE') {
// If this action is navigating to the report screen and the top most navigator is different from the one we want to navigate - PUSH
if (action.payload.name === NAVIGATORS.CENTRAL_PANE_NAVIGATOR && getTopmostReportId(root.getState()) !== getTopmostReportId(state)) {
action.type = 'PUSH';
// If the type is UP, we deeplinked into one of the RHP flows and we want to replace the current screen with the previous one in the flow
// and at the same time we want the back button to go to the page we were before the deeplink
} else if (type === 'UP') {
action.type = 'REPLACE';
// If this action is navigating to the RightModalNavigator and the last route on the root navigator is not RightModalNavigator then push
} else if (action.payload.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR && _.last(root.getState().routes).name !== NAVIGATORS.RIGHT_MODAL_NAVIGATOR) {
action.type = 'PUSH';
}
}

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

To align the navigation behavior with the expected user flow, we can adjust how we handle NAVIGATE actions in our navigation actions handler. If none of the existing conditions (e.g., navigating to the report screen, deep linking into one of the RHP flows, etc.) are met and the action type is still NAVIGATE, we can set the action type to PUSH. This will ensure a new instance of the screen is added to the navigation stack, maintaining the user's navigational context.

Here's the adjusted part of the code:

// If action type is different than NAVIGATE we can't change it to the PUSH safely
if (action.type === 'NAVIGATE') {
    // If this action is navigating to the report screen and the top most navigator is different from the one we want to navigate - PUSH
    if (action.payload.name === NAVIGATORS.CENTRAL_PANE_NAVIGATOR && getTopmostReportId(root.getState()) !== getTopmostReportId(state)) {
        action.type = 'PUSH';

        // If the type is UP, we deeplinked into one of the RHP flows and we want to replace the current screen with the previous one in the flow
        // and at the same time we want the back button to go to the page we were before the deeplink
    } else if (type === 'UP') {
        action.type = 'REPLACE';

        // If this action is navigating to the RightModalNavigator and the last route on the root navigator is not RightModalNavigator then push
    } else if (action.payload.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR && _.last(root.getState().routes).name !== NAVIGATORS.RIGHT_MODAL_NAVIGATOR) {
        action.type = 'PUSH';
    } else {
        action.type="PUSH"
    }
}

By doing so, if the user navigates to a specific room from the workspace settings, with this proposed change, they will be navigated to a new instance of that specific room even if an instance of that room already exists in the navigation stack. When they press the back button, they will return to the workspace settings page, aligning the behavior with user expectations.

Result:

New.Expensify.-.Google.Chrome.2023-07-28.11-29-51.mp4

@bernhardoj
Copy link
Contributor

Proposal

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

Different behavior of pressing the back button in announce and admin room after going it from the workspace page.

What is the root cause of that problem?

The navigation actually works as expected. When we do steps 2-5, here is how the navigation stack looks like:

Open announce room
Click on header
Click on workspace name to go to workspace settings
Click on three dots > Go to admin room

[LHN, ReportScreen (announce), ReportDetails (announce), Workspace, ReportScreen (admin)]

On pressing back (step 6), the admin report screen is popped out and will show the workspace page now.

[LHN, ReportScreen (announce), ReportDetails (announce), Workspace]

Now, when we go to the announce room (step 7), both Workspace and ReportDetails will be popped out from the stack.

[LHN, ReportScreen (announce)]

This is because NAVIGATE action will go to the existing page on the stack instead of pushing it.

So, when we press back (step 8), we will be brought to the LHN.

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

When we press "Go to admin room", it should pop both ReportDetails and Workspace from the stack and push the admin room to the stack, so the stack looks like this.
Expected: [LHN, ReportScreen (announce), ReportScreen (admin)]
Actual: [LHN, ReportScreen (announce), ReportDetails (announce), Workspace, ReportScreen (admin)]

So, on going back, it will go to the announce room.

To achieve it, we should replace navigate with dismissModal.

const goToRoom = useCallback(
(type) => {
const room = _.find(props.reports, (report) => report && report.policyID === policy.id && report.chatType === type && !ReportUtils.isThread(report));
Navigation.navigate(ROUTES.getReportRoute(room.reportID));
},

This is how the stack looks like on pressing each button:
Go to announce room: [LHN, ReportScreen (announce)]
Go to admin room: [LHN, ReportScreen (announce), ReportScreen (admin)]

Pressing the button will basically close the RHP.

This won't achieve the expected behavior, but I think this is how the navigation should be done. If the user want to go to the workspace page again, they need to press the room header again.

@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2023
@muttmuure
Copy link
Contributor

Will look at this tomorrow

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 4, 2023

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

@muttmuure
Copy link
Contributor

I was able to reproduce this

@melvin-bot melvin-bot bot removed the Overdue label Aug 7, 2023
@muttmuure muttmuure added External Added to denote the issue can be worked on by a contributor Overdue labels Aug 7, 2023
@melvin-bot melvin-bot bot changed the title Clicking back button takes user to LHN instead of previous page [$1000] Clicking back button takes user to LHN instead of previous page Aug 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 7, 2023

Job added to Upwork: https://www.upwork.com/jobs/~019b545eb8a3cbf0e4

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 7, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 7, 2023

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

@muttmuure muttmuure removed the Overdue label Aug 7, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 9, 2023
@anmurali
Copy link

anmurali commented Aug 9, 2023

I don't know why this is assigned to me and @muttmuure in BZ. I am unassigning myself.

@melvin-bot melvin-bot bot removed the Overdue label Aug 9, 2023
@anmurali anmurali removed their assignment Aug 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 10, 2023

@muttmuure @robertKozik 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 the Overdue label Aug 11, 2023
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 13, 2023
@bernhardoj
Copy link
Contributor

PR is ready

cc: @mananjadhav

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @bernhardoj got assigned: 2023-09-04 13:40:08 Z
  • when the PR got merged: 2023-09-15 05:40:39 UTC
  • days elapsed: 8

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 20, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Clicking back button takes user to LHN instead of previous page [HOLD for payment 2023-09-27] [$1000] Clicking back button takes user to LHN instead of previous page Sep 20, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.71-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-09-27. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
  • [@mananjadhav] 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:
  • [@mananjadhav] 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:
  • [@mananjadhav] Determine if we should create a regression test for this bug.
  • [@mananjadhav] 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.
  • [@muttmuure] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Sep 26, 2023
@muttmuure
Copy link
Contributor

Regression period ends today

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 27, 2023
@danieldoglas
Copy link
Contributor

just waiting for payment

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@mananjadhav
Copy link
Collaborator

mananjadhav commented Oct 2, 2023

Based on our fix, I think the Navigation was working as expected, but we changed the expected behavior. I don't think we have an offending PR, but we should add regression test for this one. The QA Steps from the PR look good to me here. What do you think @danieldoglas?

@muttmuure Can you please post a payout summary and do the payout for the contributors? I will be raising my request on NewDot. Also I think this is eligible for timelines bonus. We decided this put this on hold, and asked to start the PR in this comment.

@danieldoglas
Copy link
Contributor

danieldoglas commented Oct 2, 2023

The QA Steps from the PR look good to me here.

agreed

@mananjadhav

This comment was marked as outdated.

@muttmuure
Copy link
Contributor

C+ @mananjadhav - $1500
C - @bernhardoj - $1500
Reporter - @Nathan-Mulugeta - $250

@JmillsExpensify
Copy link

$1,500 payment approved for @mananjadhav based on BZ summary.

@mananjadhav
Copy link
Collaborator

@muttmuure did we do the payout for @bernhardoj and @Nathan-Mulugeta? If yes then we are good to close this one out.

@Nathan-Mulugeta
Copy link

Payment has not been processed yet.

@muttmuure
Copy link
Contributor

Everyone has been paid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests