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

[$1000] Web - Old Paypal username appears even after deleting #23092

Closed
1 of 6 tasks
kbecciv opened this issue Jul 18, 2023 · 14 comments
Closed
1 of 6 tasks

[$1000] Web - Old Paypal username appears even after deleting #23092

kbecciv opened this issue Jul 18, 2023 · 14 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Jul 18, 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 Paypal page using link https://staging.new.expensify.com/settings/payments/add-paypal-me
  2. Add or edit username and click on save button
  3. From payments page click on Paypal username and delete it
  4. Click on Add payment method button and choose Paypal option

Expected Result:

Old Paypal username should not show

Actual Result:

Old Paypal username appears

Workaround:

Unknown

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: Dev 1.3.42-6
Reproducible in staging?: n/a
Reproducible in production?: n/a
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.2023-07-18.at.11.37.56.AM.mov

Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689660873381289

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01564b9340e7c3d9e9
  • Upwork Job ID: 1681650980433195008
  • Last Price Increase: 2023-07-19
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 18, 2023
@dukenv0307
Copy link
Contributor

Proposal

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

old Paypal username appears even after deleting

What is the root cause of that problem?

When we open add paypal by deep link and confirm to go to the setting payment page, we already have a paypal page in navigation stack. After we delete paypal account and go to add paypal page again, the old paypal page doesn't unmount and then old name is displayed by this page.

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

We can use HOC withNavigationFocus and add an useEffect to reset payPalMeUsername state

useEffect(() => {
    setPayPalMeUsername(lodashGet(props.payPalMeData, 'accountData.username', ''))
}, [props.isFocused])

What alternative solutions did you explore? (Optional)

We also can navigate with type UP to remove the paypal page from navigation stack whenever we add or edit paypal

Navigation.navigate(ROUTES.SETTINGS_PAYMENTS, 'UP');

Navigation.navigate(ROUTES.SETTINGS_PAYMENTS);

@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

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

@melvin-bot
Copy link

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

@hungvu193
Copy link
Contributor

hungvu193 commented Jul 18, 2023

Do you think this is counted as regression from our previous PR @eVoloshchak, If yes then I can create a PR to fix this one
#22620

@eVoloshchak
Copy link
Contributor

@hungvu193, could you revert the PR and check if the bug is still present?
If not, yeah, let's spin up the PR to fix it

@hungvu193
Copy link
Contributor

@hungvu193, could you revert the PR and check if the bug is still present? If not, yeah, let's spin up the PR to fix it

Just reverted it, it still happened, it seems like a navigation issue more than a regression. I think it's not regression 😄

@hungvu193
Copy link
Contributor

Proposal

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

Web - Old Paypal username appears even after deleting

What is the root cause of that problem?

After saving user paypal account, we navigate back instead of going back, when accessing from deeplink, the AddPaypalPage is in the background and never unmounted, so the value from TextInput was still there which caused this issue.

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

Instead of going back after saving, we can use goBack. Also don't forget to add fallbackroute as ROUTES.SETTINGS_PAYMENTS:

    const setPayPalMeData = useCallback(() => {
        if (!ValidationUtils.isValidPaypalUsername(payPalMeUsername)) {
            setPayPalMeUsernameError(true);
            return;
        }
        setPayPalMeUsernameError(false);
        User.addPaypalMeAddress(payPalMeUsername);

        Growl.show(growlMessageOnSave, CONST.GROWL.SUCCESS, 3000);
     // We should go back instead of navigating.
        Navigation.goBack(ROUTES.SETTINGS_PAYMENTS);
    }, [payPalMeUsername, growlMessageOnSave]);

What alternative solutions did you explore? (Optional)

N/A

@kevinksullivan kevinksullivan added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Jul 19, 2023
@melvin-bot melvin-bot bot changed the title Web - Old Paypal username appears even after deleting [$1000] Web - Old Paypal username appears even after deleting Jul 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01564b9340e7c3d9e9

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

Was able to reproduce on staging

@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

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

@dukenv0307
Copy link
Contributor

It is fixed in this PR #23086

@sobitneupane
Copy link
Contributor

sobitneupane commented Jul 21, 2023

Issue no longer reproducible.

cc: @kevinksullivan

@melvin-bot melvin-bot bot added the Overdue label Jul 24, 2023
@kevinksullivan
Copy link
Contributor

Closing out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

6 participants