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-08-01] Back button after clicking on menu gets back to list of workspace on admins channel( works well if not clicked on menu) #22065

Closed
1 of 6 tasks
kavimuru opened this issue Jul 2, 2023 · 29 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kavimuru
Copy link

kavimuru commented Jul 2, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to web chrome on staging dot
  2. Go to any admins channel and click on header
  3. Click on workspace name below admins channel and notice the workspace opens up
  4. Now click on back button and see it naviagtes back to admin channel which is working well
  5. But now again click on workspace and now click on any menu of the workspace and click on back button so that we can get back to admins channel
  6. But notice that on clicking on back button from the workspace page, it navigates to the workspace lists (Whereas in the previous case, it navigated back to the admins channel)

Expected Result:

The back button after clicking on menu should get back to admins channel

Actual Result:

Back button after clicking on menu gets back to list of workspace on admins channel( works well if not clicked on menu)

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.35-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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

error-2023-06-07_18.01.26.mp4
Recording.2290.mp4

Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686140160128449

View all open jobs on GitHub

@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 2, 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

@StevenKKC
Copy link
Contributor

StevenKKC commented Jul 3, 2023

Proposal

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

Clicking back button after clicking on menu gets back to list of workspace on admins channel.

What is the root cause of that problem?

If the user clicks on the workspace name on the report detail page, the navigation will create a new item in the RightModalNavigator because Report_Details_Root and Workspace_Initial are different screens in linkingConfig.
Therefore, there are two items in the RightModalNavigator.
Annotation 2023-07-03 070335

When user click menu, the menu item and workspace initial page are on the same screen in linkingConfig, new item will be added to Workspace_Initial.
Annotation 2023-07-03 064710

When the user clicks the back button, navigation will iterate Workspace_Settings screen routes and return 0.

const getActiveRouteIndex = function (route, index) {
if (route.routes) {
const childActiveRoute = route.routes[route.index || 0];
return getActiveRouteIndex(childActiveRoute, route.index || 0);
}
if (route.state && route.state.routes) {
const childActiveRoute = route.state.routes[route.state.index || 0];
return getActiveRouteIndex(childActiveRoute, route.state.index || 0);
}
if (route.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR) {
return 0;
}
return index;
};

And since fallbackRoute is set, fallbackRoute will be navigated accordingly.
if (shouldEnforceFallback || (!getActiveRouteIndex(navigationRef.current.getState()) && fallbackRoute)) {
navigate(fallbackRoute, 'UP');
return;
}

fallbackRoute is set to ROUTES.SETTINGS_WORKSPACES, so we'll be returned to the list of workspaces.

onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)}

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

We can modify this line as below.

-   if (shouldEnforceFallback || (!getActiveRouteIndex(navigationRef.current.getState()) && fallbackRoute)) {
+   if (shouldEnforceFallback || (getActiveRouteIndex(navigationRef.current.getState()) == null && fallbackRoute)) {

What alternative solutions did you explore? (Optional)

We can remove fallbackRoute in WorkspaceInitialPage.js.

-   onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WORKSPACES)}
+   onBackButtonPress={() => Navigation.goBack()}

@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@JmillsExpensify
Copy link

Slammed with bug reports. I'll close the loop on these today.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 2023

@JmillsExpensify Eep! 4 days overdue now. Issues have feelings too...

@JmillsExpensify
Copy link

@mountiny more navigation bugs. I wanted to confirm that we should actually go UP vs BACK in this case?

@melvin-bot melvin-bot bot removed the Overdue label Jul 12, 2023
@mountiny
Copy link
Contributor

mountiny commented Jul 12, 2023

I think this is kinda expected but there will be potentially a lot of edge cases in these flows. Essentially we are deeplinking to the workspace settings and the up button should lead to the workspace list and settings basically down the path you would expect in RHP.

Browser back should lead to the admin page I assume.


I have missed one part of it, asking SWM if they can look into fixing this

@melvin-bot
Copy link

melvin-bot bot commented Jul 16, 2023

@JmillsExpensify this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@mountiny mountiny moved this from Todo to Review Proposals in Navigation Refactor Follow-ups Jul 17, 2023
@mountiny
Copy link
Contributor

@adamgrzybowski what do you think of the proposal above?

@adamgrzybowski
Copy link
Contributor

I am afraid that this function never returns a null.

if (shouldEnforceFallback || (getActiveRouteIndex(navigationRef.current.getState()) == null && fallbackRoute)) {

So we never enter this if now and it is responsible for handling the up button after deep linking.

e.g.

  1. Copy http://localhost:8080/settings/profile
  2. Press the UP button

Expected:
The user should be on the settings page

Actual:
RHP is completely closed

@StevenKKC
Copy link
Contributor

@adamgrzybowski Because 0 is a valid route index, so we should check for getActiveRouteIndex returns null or undefined. == null just check for an undefined or null value.

@adamgrzybowski
Copy link
Contributor

Yeah but it still breaks the flow described above

@adamgrzybowski
Copy link
Contributor

Hey, we made a quick fix with @WoLewicki while investigating issues with those flows.

@mountiny
Copy link
Contributor

@StevenKKC Thanks for the proposal, the navigation reboot has been a project we worked on with SWM so they have more context about the changes, we appreciate your contributions and hopefully you can find some issue with Help Wanted label which you can help us with!

@mountiny mountiny removed the Weekly KSv2 label Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

@JmillsExpensify, @mountiny, @adamgrzybowski Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@JmillsExpensify
Copy link

Should we now close this issue based on the linked quick fix above? I see that's merged.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 25, 2023
@melvin-bot melvin-bot bot changed the title Back button after clicking on menu gets back to list of workspace on admins channel( works well if not clicked on menu) [HOLD for payment 2023-08-01] Back button after clicking on menu gets back to list of workspace on admins channel( works well if not clicked on menu) Jul 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.44-2 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-08-01. 🎊

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 Jul 25, 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:

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

@JmillsExpensify
Copy link

Not sure who's kicking off the bug zero checklist above, though that's our todo between now and when the regression period passes.

@mountiny
Copy link
Contributor

@allroundexperts Can you handle the checklist given you have reviewed the PR pleasE?

@allroundexperts
Copy link
Contributor

Will do that today @mountiny!

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jul 31, 2023
@JmillsExpensify
Copy link

JmillsExpensify commented Aug 2, 2023

In the meantime, summarizing the payments for this issue:

@mountiny Would you please confirm that this is eligible for the bonus? It was based on the PR alone.

Upwork job is here for issue reporter.

@melvin-bot melvin-bot bot removed the Overdue label Aug 2, 2023
@priya-zha
Copy link

Applied. Thanks.

@mountiny
Copy link
Contributor

mountiny commented Aug 6, 2023

@JmillsExpensify so Adam is agency worker so as that I think most of these project issues they work on are handled as internal review so flat $1000 and no urgency bonus.

Also Adam in paid differently so he does not have to be in the summary

It should be $1000 to @allroundexperts here I believe.

Thanks everyone for good work here 🚀

@melvin-bot melvin-bot bot added the Overdue label Aug 8, 2023
@JmillsExpensify
Copy link

Ok thank you for confirming the special situations! Updated the amounts above. @allroundexperts have you submitted via NewDot? I'll check there in any case shortly. Then @priya-zha offer was sent via Upwork.

@melvin-bot melvin-bot bot removed the Overdue label Aug 9, 2023
@allroundexperts
Copy link
Contributor

Requested now @JmillsExpensify

@JmillsExpensify
Copy link

Issue reporter is paid out and @allroundexperts is approved for payment via NewDot, so I'm closing this issue out.

@github-project-automation github-project-automation bot moved this from Review Proposals to Done in Navigation Refactor Follow-ups Aug 10, 2023
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
Projects
No open projects
Development

No branches or pull requests

7 participants