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-12-12] [$500] Save the World - Navigation problem on teachers contact page after a reload #31895

Closed
3 of 6 tasks
izarutskaya opened this issue Nov 27, 2023 · 26 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 External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Nov 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!


Version Number: v1.4.3-6
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:
Slack conversation: @

Action Performed:

  1. Click on FAB
  2. Click Save the World > I am a teacher
  3. Click on the "Update email address" button at the bottom. (or the 'contact methods' link)
  4. Click on New contact method
  5. Refresh page.
  6. Click on the back button twice

Expected Result:

Navigating back takes you to the "I am a Teacher" page

Actual Result:

Navigating back takes you to the "Profile" 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

Bug6289465_1700828211394.test13_teacherNavigation.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01635fe8e43e66eeee
  • Upwork Job ID: 1728930388464914432
  • Last Price Increase: 2023-11-27
  • Automatic offers:
    • shubham1206agra | Reviewer | 27851097
    • ZhenjaHorbach | Contributor | 27851099
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 27, 2023
@melvin-bot melvin-bot bot changed the title Save the World - Navigation problem on teachers contact page after a reload [$500] Save the World - Navigation problem on teachers contact page after a reload Nov 27, 2023
Copy link

melvin-bot bot commented Nov 27, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01635fe8e43e66eeee

Copy link

melvin-bot bot commented Nov 27, 2023

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

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

melvin-bot bot commented Nov 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

Copy link

melvin-bot bot commented Nov 27, 2023

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

@abzokhattab
Copy link
Contributor

abzokhattab commented Nov 27, 2023

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

Save the World - Navigation back doesn't work correctly on teachers new contact method page after a reload

What is the root cause of that problem?

the current contact-methods url is used in two places in the teacher url and in the profile settings so thats why we use the back to with the /contact-methods ..

in the case of the /contact-methods/new, when we click on back it brings us back to the contact-methods but doesnt specify the back-to

so in the /contact-methods/new back navigation, we should add backTo=/settings/profile/contact-methods?backTo=%2Fteachersunite%2Fi-am-a-teacher to the route and change goBack to navigate

onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.route)}

@shubham1206agra
Copy link
Contributor

@mkhutornyi Where did your proposal go?

@codecreator28
Copy link

Proposal

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

Save the World - Navigation problem on teachers contact page after a reload

What is the root cause of that problem?

The root cause is just in this code line:
const navigateBackTo = lodashGet(props.route, 'params.backTo', ROUTES.SETTINGS_PROFILE);
This line of code is retrieving a parameter named backTo from the current route's parameters. If the backTo parameter is not present, the default value of ROUTES.SETTINGS_PROFILE will be used.

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

in src/pages/settings/Profile/Contacts/ContactMethodsPage.js
change
const navigateBackTo = lodashGet(props.route, 'params.backTo', ROUTES.SETTINGS_PROFILE);
to
const navigateBackTo = lodashGet(props.route, 'params.backTo', ROUTES.TEACHERS_UNITE);

What alternative solutions did you explore? (Optional)

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Nov 27, 2023

Proposal

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

Save the World - Navigation back doesn't work correctly on teachers new contact method page after a reload

What is the root cause of that problem?

The main problem is that when we get to the NewContactMethodPage screen we do not save the history of previous screens
And since ContactMethodsPage is used in two places
Then when we try to go back
We get to the default screen

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

To fix this bug we need make some changes

  1. Update ROUTES
    SETTINGS_NEW_CONTACT_METHOD: {
        route: 'settings/profile/contact-methods/new',
        getRoute: (backTo?: string) => `${getUrlWithBackToParam('settings/profile/contact-methods/new', backTo)}`,
    },

SETTINGS_NEW_CONTACT_METHOD: 'settings/profile/contact-methods/new',

  1. Update linking config
  Settings_NewContactMethod: {
      path: ROUTES.SETTINGS_NEW_CONTACT_METHOD.route,
      exact: true,
   },

Settings_NewContactMethod: {
path: ROUTES.SETTINGS_NEW_CONTACT_METHOD,
exact: true,
},

  1. Update ContactMethodsPage

onPress={() => Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.getRoute(navigateBackTo))}

onPress={() => Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD)}

  1. Update NewContactMethodPage

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

onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(navigateBackTo))}

onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.route)}

What alternative solutions did you explore? (Optional)

NA

@mkhutornyi
Copy link
Contributor

@mkhutornyi Where did your proposal go?

Sorry not sure but I think it was accidentally removed.

Reposting

Proposal

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

Save the World - Navigation back doesn't work correctly on teachers new contact method page after reload

What is the root cause of that problem?

new contact method page doesn't have backTo param unlike contact methods page
/settings/profile/contact-methods/new
/settings/profile/contact-methods?backTo=%2Fteachersunite%2Fi-am-a-teacher

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

Similar to contact methods page, add backTo param on new contact method page
Files to update: ROUTES, linkingConfig, ContactMethods Button onPress, NewContactMethodPage onBackButtonPress

Demo

demo.1.mov

@shubham1206agra
Copy link
Contributor

image

Just putting here for transparency.

Since @ZhenjaHorbach's proposal has the correct RCA, and the solution. Let's go with this.
🎀 👀 🎀 C+ reviewed

Just a note for @ZhenjaHorbach, we should call it something else other than backTo as this might be a bit misleading

Copy link

melvin-bot bot commented Nov 27, 2023

Triggered auto assignment to @tylerkaraszewski, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@aimane-chnaif
Copy link
Contributor

Can we merge this into #31892?
Similar but just happening in different place

Copy link

melvin-bot bot commented Nov 27, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@tienifr
Copy link
Contributor

tienifr commented Nov 27, 2023

Can we merge this into #31892?
Similar but just happening in different place

@aimane-chnaif That is a different problem and requires a different solution. Because the component there was wrapped inside another one.

@mkhutornyi
Copy link
Contributor

@shubham1206agra If my previous proposal is considered, just want to know what's wrong with my proposal.
From guideline, the proposal doesn't need to be full code implementation.
Accepted proposal is more like PR. I thought just idea was fine.
Not complaining but just to consider for future issues. Thanks

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Nov 27, 2023

@shubham1206agra If my previous proposal is considered, just want to know what's wrong with my proposal. From guideline, the proposal doesn't need to be full code implementation. Accepted proposal is more like PR. I thought just idea was fine. Not complaining but just to consider for future issues. Thanks

I can say from my side )
The proposal must have a minimum set of steps that need to be taken for this solution to work (In most cases, there is no need to offer a ready-made solution. But sending the lines in the code where corrections need to be made is mandatory )
Moreover, many reviewers want to check the solution themselves
And abstract answers where there is no explanation of what needs to be done do not allow it to be done

@shubham1206agra
Copy link
Contributor

@shubham1206agra If my previous proposal is considered, just want to know what's wrong with my proposal. From guideline, the proposal doesn't need to be full code implementation. Accepted proposal is more like PR. I thought just idea was fine. Not complaining but just to consider for future issues. Thanks

Actually there's some explanation missing on why do we need backTo, and how did we reach the conclusion that we require backTo here.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 27, 2023
Copy link

melvin-bot bot commented Nov 27, 2023

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

Offer link
Upwork job

Copy link

melvin-bot bot commented Nov 27, 2023

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

@ZhenjaHorbach
Copy link
Contributor

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

PR will be ready today or tomorrow

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 27, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 5, 2023
@melvin-bot melvin-bot bot changed the title [$500] Save the World - Navigation problem on teachers contact page after a reload [HOLD for payment 2023-12-12] [$500] Save the World - Navigation problem on teachers contact page after a reload Dec 5, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 5, 2023
Copy link

melvin-bot bot commented Dec 5, 2023

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

Copy link

melvin-bot bot commented Dec 5, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.7-4 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-12-12. 🎊

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:

Copy link

melvin-bot bot commented Dec 5, 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:

  • [@shubham1206agra] The PR that introduced the bug has been identified. Link to the PR:
  • [@shubham1206agra] 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:
  • [@shubham1206agra] 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:
  • [@shubham1206agra] Determine if we should create a regression test for this bug.
  • [@shubham1206agra] 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.
  • [@adelekennedy] 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 Dec 11, 2023
@adelekennedy
Copy link

Payouts due:

Contributor: $500 @ZhenjaHorbach
Contributor+: $500 @shubham1206agra

@shubham1206agra will you complete the checklist above so we can close this out?

@shubham1206agra
Copy link
Contributor

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:

Copy link

melvin-bot bot commented Mar 14, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

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

10 participants