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-10-02] [$1000] Add a mandatory route param to Navigation.goBack to prevent bugs #24291

Closed
6 tasks
neil-marcellini opened this issue Aug 8, 2023 · 55 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@neil-marcellini
Copy link
Contributor

neil-marcellini commented Aug 8, 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!


Problem

Calling Navigation.goBack() in App without a route can cause problems since it will navigate to the wrong page if the desired page to go back to is not the last page in the navigation history.

Solution

Add a mandatory route param to Navigation.goBack so that the screen to navigate back to must be specified. Discussed in Slack here.

Platforms:

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

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

Version Number:
Reproducible in staging?:
Reproducible in production?:
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
Expensify/Expensify Issue URL:
Issue reported by: @neil-marcellini
Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ee5e103f65c1a8fa
  • Upwork Job ID: 1688984859314130944
  • Last Price Increase: 2023-08-08
  • Automatic offers:
    • abdulrahuman5196 | Contributor | 26164451
@neil-marcellini neil-marcellini added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 8, 2023
@neil-marcellini neil-marcellini self-assigned this Aug 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 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

@neil-marcellini neil-marcellini added the External Added to denote the issue can be worked on by a contributor label Aug 8, 2023
@melvin-bot melvin-bot bot changed the title Add a mandatory route param to Navigation.goBack to prevent bugs [$1000] Add a mandatory route param to Navigation.goBack to prevent bugs Aug 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01ee5e103f65c1a8fa

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

melvin-bot bot commented Aug 8, 2023

Current assignee @sophiepintoraetz is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Aug 8, 2023

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

@situchan
Copy link
Contributor

situchan commented Aug 8, 2023

Dupe of #22041?

@neil-marcellini
Copy link
Contributor Author

No this is a general improvement coming from Slack. Oh lol but I do see that we're having parallel conversations.

@situchan
Copy link
Contributor

situchan commented Aug 8, 2023

We're trying to fix globally in that issue.

@neil-marcellini
Copy link
Contributor Author

Ok cool then I'll close this and link to the conversation we had.

@neil-marcellini neil-marcellini closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2023
@abdulrahuman5196
Copy link
Contributor

@neil-marcellini I think there is a subtle difference on what is being targetted there and what we are targetting here.

  1. [HOLD for payment 2023-10-18] [$1000] Visit the Room welcome message edit page by direct link then click save button, it navigates back to the chatReport instead of Room setting page #22041 deals with how we fix all the existing Navigation.goBack() to have fallback routes.
  2. But What I proposed was to handle future cases(since we where thinking of adding it to checklist), like even after the other fix is made there is nothing stopping contributors from making the same mistake of just using Navigation.goBack() . So if we make the fallback param mandatory, Navigation.goBack(fallback) would be only way to use the function. So if they don't want any specific screen, they can give home as fallback or they have to give some proper screen as fallback.

@neil-marcellini
Copy link
Contributor Author

Ok that sounds different enough. I'll re-open this.

@hanzalahsamana
Copy link

I would love to work on this @neil-marcellini

@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

📣 @hanzalahsamana! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@mananjadhav
Copy link
Collaborator

@hanzalahsamana Please checkout our contributing guidelines to send out a proposal.

@hanzalahsamana
Copy link

Proposal

Please re-state the problem that we are trying to solve in this issue.
We're dealing with a situation where using Navigation.goBack() in the App without telling where to go might cause problems. It can lead to going to the wrong place if the wanted page isn't the last one in the history.

What is the root cause of that problem?
The issue comes from not being clear when using Navigation.goBack(). It's like not saying where you want to go, and that can make users end up in unexpected places.

What changes do you think we should make in order to solve the problem?
To fix this, we should make sure everyone uses Navigation.goBack() with a clear plan. We can do this by making it necessary to say where to go when using Navigation.goBack(). This way, we avoid confusion. If someone doesn't have a specific place in mind, they can set a default spot, like the main screen.

What alternative solutions did you explore? (Optional)
We thought about giving extra instructions to avoid using Navigation.goBack() without saying where to go. But this might not work well since not everyone might read those instructions. The mandatory fallback idea is more reliable because it guarantees correct navigation, no matter who is using it.

I appreciate your time considering this plan. If you want to talk more about it, I'm here to help.

Best regards,
Hanzalah

@neil-marcellini
Copy link
Contributor Author

@mananjadhav FYI I want to give first pick on this to @abdulrahuman5196 since we planned it together in Slack here. Abdul please post a proposal soon, and Manan please review his first.

@mananjadhav
Copy link
Collaborator

Sure. Will wait for @abdulrahuman5196 to post a proposal.

@abdulrahuman5196
Copy link
Contributor

Proposal

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

Calling Navigation.goBack() in App without a fallback route will cause it to navigate to the HOME page if there is no back page to go. Like is the cases of refresh for eg. #22290. To fix this we have been adding fallback routes for different pages in different issue. But it will not stop a contributor from making the same mistake of just calling Navigation.goBack() in future.

What is the root cause of that problem?

Same as problem statement.

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

We will make the fallback route param in navigation.goBack() mandatory - https://github.com/Expensify/App/blob/main/src/libs/Navigation/Navigation.js#L99
So if we make the fallback param mandatory, Navigation.goBack(fallback) would be only way to use the function. So if they don't want any specific screen, they can give home as fallback or they have to give some proper screen as fallback.

What alternative solutions did you explore? (Optional)

This way of making the param mandatory was proposed as an alternative to adding a checklist item. We could also add an checklist item.

@melvin-bot melvin-bot bot added the Overdue label Aug 13, 2023
@melvin-bot melvin-bot bot removed the Overdue label Aug 31, 2023
@sophiepintoraetz
Copy link
Contributor

I've bumped @neil-marcellini in new dot twice now - will escalate to slack after the holiday if we don't hear from him!

@neil-marcellini
Copy link
Contributor Author

I'm looking now sorry for the delay.

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

📣 @mananjadhav Please request via NewDot manual requests for the Reviewer role ($1000)

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

📣 @Prince-Mendiratta You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@neil-marcellini
Copy link
Contributor Author

To be clear, @Prince-Mendiratta and @abdulrahuman5196 will be splitting the payment for this issue.

@Prince-Mendiratta
Copy link
Contributor

PR is up! Kindly help review, @mananjadhav @abdulrahuman5196 @neil-marcellini :D

@Prince-Mendiratta
Copy link
Contributor

@neil-marcellini The C+ for the PR was wrongly assigned, causing @mananjadhav to miss out on the PR, can you please assign him as the C+? Lots of PRs merging in, wouldn't want any regressions coming in due to delays.

Thanks!

@sophiepintoraetz
Copy link
Contributor

I've assigned him!

@mananjadhav
Copy link
Collaborator

I am a bit unwell and I'll try to close this by tomorrow.

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 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 @Prince-Mendiratta got assigned: 2023-09-04 18:27:08 Z
  • when the PR got merged: 2023-09-20 08:48:05 UTC
  • days elapsed: 11

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 25, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Add a mandatory route param to Navigation.goBack to prevent bugs [HOLD for payment 2023-10-02] [$1000] Add a mandatory route param to Navigation.goBack to prevent bugs Sep 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 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-10-02. 🎊

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 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:

  • [@mananjadhav / @abdulrahuman5196] The PR that introduced the bug has been identified. Link to the PR:
  • [@mananjadhav / @abdulrahuman5196] 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 / @abdulrahuman5196] 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 / @abdulrahuman5196] Determine if we should create a regression test for this bug.
  • [@mananjadhav / @abdulrahuman5196] 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.
  • [@sophiepintoraetz] 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 and removed Weekly KSv2 labels Oct 1, 2023
@sophiepintoraetz
Copy link
Contributor

sophiepintoraetz commented Oct 1, 2023

Payouts due:

Issue Reporter: $250 N/A - Neil
Splitting payment as per this comment here
Contributor: $500 @abdulrahuman5196
Contributor: $500 @Prince-Mendiratta
Contributor+: $1000 @mananjadhav

Eligible for 50% #urgency bonus? N

@mananjadhav
Copy link
Collaborator

We can treat this as a feature request, and not directly related to any specific feature here. We don't need a regression suite here as these can be covered in other features. We only changed by forcing an arg in the method call.

@JmillsExpensify
Copy link

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

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants