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

[$500] Navigation - When opening "Referral" page using link "Got It" button redirect to search #31866

Closed
6 tasks done
lanitochka17 opened this issue Nov 25, 2023 · 42 comments
Closed
6 tasks done
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 25, 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!


Version Number: 1.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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to the Search > Refer a friend
  2. Copy the Referral page URL link
  3. Send the URL link to the user
  4. Click on that link and click on "Got it" or "<" button
  5. Notice the search page is displayed instead of closing the page

Expected Result:

When opening the "Referral" page using the link, the "Got It" and "<" buttons should close the page

Actual Result:

When opening the "Referral" page using the link, the "Got It" and "<" buttons take the user back to the search page instead of closing the 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

Add any screenshot/video evidence

Bug6289330_1700818389458.2023-11-24_03-19-46.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f28b50791a020965
  • Upwork Job ID: 1728458774858543104
  • Last Price Increase: 2023-11-25
  • Automatic offers:
    • dukenv0307 | Contributor | 27895246
    • situchan | Contributor | 28132383
@lanitochka17 lanitochka17 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 25, 2023
@melvin-bot melvin-bot bot changed the title Navigation - When opening "Referral" page using link "Got It" button redirect to search [$500] Navigation - When opening "Referral" page using link "Got It" button redirect to search Nov 25, 2023
Copy link

melvin-bot bot commented Nov 25, 2023

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

Copy link

melvin-bot bot commented Nov 25, 2023

Triggered auto assignment to @CortneyOfstad (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 25, 2023
Copy link

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

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

@cooldev900
Copy link
Contributor

cooldev900 commented Nov 25, 2023

Proposal

from: @cooldev900

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

When opening "Referral" page using link "Got It" button redirect to search

What is the root cause of that problem?

The root cause is because we get goBack route in getFallbackRoute() function depending on current route and getFallbackRoute() return search route when current route is REFER_FRIEND.

[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND]: ROUTES.SEARCH,

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

We can delete getFallbackRoute() here.

onBackButtonPress={() => Navigation.goBack(getFallbackRoute())}

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

And we need to update this line

onPress={() => Navigation.goBack(getFallbackRoute())}

to

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

What alternative solutions did you explore? (Optional)

We need to update getFallbackRoute like it.

[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND]: '',

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 25, 2023

Proposal

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

Navigation - When opening "Referral" page using link "Got It" button redirect to search

What is the root cause of that problem?

We are getting a route to navigate back based on the current route

function getFallbackRoute() {
const fallbackRoutes = {
[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.MONEY_REQUEST]: ROUTES.MONEY_REQUEST_PARTICIPANTS.getRoute(CONST.IOU.TYPE.REQUEST),
[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SEND_MONEY]: ROUTES.MONEY_REQUEST_PARTICIPANTS.getRoute(CONST.IOU.TYPE.SEND),
[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.START_CHAT]: ROUTES.NEW_CHAT,
[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND]: ROUTES.SEARCH,
};
return fallbackRoutes[contentType];
}

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

<HeaderWithBackButton

we should remove onBackButtonPress props and use the default onBackButtonPress as we did on other page

What alternative solutions did you explore? (Optional)

  1. update to
                onBackButtonPress={() => Navigation.goBack()}
  1. We can add backTo param when we go to the refer page and then we can use this param to go to the correct previous page even when we reload the page.

@salih-bektas
Copy link

Proposal

Please re-state the problem that we are trying to solve in this issue.
If the "Referral" page is accessed through a referral link, users are taken to the Search page instead of closing the page when they click "Got it" or the back button.

What is the root cause of that problem?
Fallback function is returning search page for fallback page and referralFriend page always return to search page no matter how it's called.

function getFallbackRoute() {
const fallbackRoutes = {
[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.MONEY_REQUEST]: ROUTES.MONEY_REQUEST_PARTICIPANTS.getRoute(CONST.IOU.TYPE.REQUEST),
[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.SEND_MONEY]: ROUTES.MONEY_REQUEST_PARTICIPANTS.getRoute(CONST.IOU.TYPE.SEND),
[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.START_CHAT]: ROUTES.NEW_CHAT,
[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND]: ROUTES.SEARCH,
};
return fallbackRoutes[contentType];
}

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

[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND]: ROUTES.SEARCH,

We can change this line to return ROUTES.HOME instead of ROUTES.SEARCH

What alternative solutions did you explore? (Optional)
I explored editing following line to goBack without fallback value, but it may have side effect, because there are other types of fallback values that may behave differently.

onPress={() => Navigation.goBack(getFallbackRoute())}

Copy link

melvin-bot bot commented Nov 26, 2023

📣 @salih-bektas! 📣
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. Make sure you've read and understood the contributing guidelines.
  2. 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.
  3. 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.
  4. 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>

@salih-bektas
Copy link

Contributor details
Your Expensify account email: salih.bektas@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01d13a196b17ab86e8

Copy link

melvin-bot bot commented Nov 26, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@codeweb05
Copy link

Issue Summary

When users access the "Referral" page through a referral link and attempt to close it using the "Got It" or back buttons, they are redirected to the search page instead of the expected behavior of closing the page.

Root Cause

The issue originates from the getFallbackRoute() function in App/src/pages/ReferralDetailsPage.js, specifically for the REFER_FRIEND route, which results in an unintended redirection to the search page.

Proposed Changes

Proposal

Problem Restatement:
Upon opening the "Referral" page through a link, the "Got It" button and back button redirect users to the search page instead of closing the page as expected.

Root Cause:
The root cause lies in the getFallbackRoute() function, which dictates the fallback route for the REFER_FRIEND scenario.

Proposed Changes:

  1. Simplify getFallbackRoute():
    In App/src/pages/ReferralDetailsPage.js, remove the getFallbackRoute() function (line 61).

  2. Update Back Button Press:
    Modify the back button press action in App/src/pages/ReferralDetailsPage.js (line 75) to:

    onBackButtonPress={() => Navigation.goBack()}
  3. Refactor Button Press Handling:
    Update the button press handling in App/src/pages/ReferralDetailsPage.js (line 101) to:

    onPress={() => Navigation.goBack()}

Alternative Consideration

If necessary, consider adjusting the fallback route directly in the route configuration for REFER_FRIEND (line 61):

[CONST.REFERRAL_PROGRAM.CONTENT_TYPES.REFER_FRIEND]: ROUTES.HOME,

@ArekChr
Copy link
Contributor

ArekChr commented Nov 27, 2023

It looks like all proposals will introduce the previous regression where the fix was implementing fallback routes #31628

@dukenv0307
Copy link
Contributor

@ArekChr I tested my proposal and the previous bug didn't happen because we handled it in another issue

@ArekChr
Copy link
Contributor

ArekChr commented Nov 29, 2023

@dukenv0307 I tested it, and it works. I agree that we should remove the onBackButtonPress function and let the navigation handle this functionality. The proposal solves that problem and doesn't break the navigation flow.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 29, 2023

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

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

melvin-bot bot commented Nov 30, 2023

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

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Dec 1, 2023
@ArekChr
Copy link
Contributor

ArekChr commented Dec 7, 2023

@CortneyOfstad Review in progress

@CortneyOfstad
Copy link
Contributor

@ArekChr any updates? Thanks!

@CortneyOfstad
Copy link
Contributor

@ArekChr bump ^^^ TIA!

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jan 2, 2024

The PR is still being reviewed now.

@CortneyOfstad
Copy link
Contributor

@dukenv0307 any update o the PR? Thanks!

@dukenv0307
Copy link
Contributor

@CortneyOfstad Seem like @ArekChr isn't working. Can you please assign another C+ here?

@situchan
Copy link
Contributor

@ArekChr is working but just no longer C+. I can take over.

@dukenv0307
Copy link
Contributor

@ArekChr is working but just no longer C+. I can take over.

@CortneyOfstad @Beamanator can you assign another C+ to review the PR? @situchan is volunteering here

@Beamanator Beamanator assigned situchan and unassigned ArekChr Jan 31, 2024
@Beamanator
Copy link
Contributor

Thanks @situchan !

Copy link

melvin-bot bot commented Jan 31, 2024

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

@CortneyOfstad
Copy link
Contributor

Thanks @situchan!

@CortneyOfstad
Copy link
Contributor

Any update on the PR/review @situchan @dukenv0307? Thanks!

@dukenv0307
Copy link
Contributor

Waiting for reviewing from @situchan

@situchan
Copy link
Contributor

yup conflict/lint fixed yesterday so I am planning review today

@CortneyOfstad
Copy link
Contributor

@situchan is there any update based on the comment above? If the PR has not been reviewed, do you think this could be completed by EOD?

@situchan
Copy link
Contributor

@CortneyOfstad PR was deployed to staging 3 days ago.
Expect hitting production next week due to deploy freeze this week for important event

@CortneyOfstad
Copy link
Contributor

Perfect — thank you!

@situchan
Copy link
Contributor

situchan commented Mar 6, 2024

PR was deployed to production on Feb 26

@CortneyOfstad CortneyOfstad added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Mar 11, 2024
@CortneyOfstad
Copy link
Contributor

Was OoO last week — not sure why the system didn't update this for payment, but getting that tackled now!

@CortneyOfstad
Copy link
Contributor

Payment Summary

@dukenv0307 paid $500 via Upwork
@situchan paid $500 via Upwork

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

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

@CortneyOfstad
Copy link
Contributor

@situchan can you complete the checklist above? Thanks!

@situchan
Copy link
Contributor

Offending PR with comment: https://github.com/Expensify/App/pull/30372/files#r1520060022
As this is unusual case, not worth raising discussion on slack.
As this was caught by QA team, we can skip regression test.

@CortneyOfstad
Copy link
Contributor

Sounds good! Closing!

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

No branches or pull requests

9 participants