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

Settings - When user clicks 'Save' without changing their username "Your PayPal username was successfully saved" popup message appears #26889

Closed
1 of 6 tasks
izarutskaya opened this issue Sep 6, 2023 · 5 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@izarutskaya
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open settings
  2. Open wallet
  3. Click on Add payment method and select paypal.me if you don't add PayPal before
  4. Enter user name and click add paypal account
  5. Click on your PayPal account
  6. Click on Edit
  7. Click on save without editing

Expected Result:

The "Your PayPal username was successfully saved" popup message should not appear if there is no username change

Actual Result:

"Your PayPal username was successfully saved" popup message appears without the user changing anything

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: v1.3.64-2

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

2023-08-29.12-32-59.mp4
20230906_232658.mp4

Expensify/Expensify Issue URL:

Issue reported by: @jo-ui

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693301255846379

View all open jobs on GitHub

@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 6, 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

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Sep 6, 2023

Proposal

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

When user clicks 'Save' without changing their username "Your PayPal username was successfully saved" popup message appears

What is the root cause of that problem?

We are not checking if previous value of name is same as new value before showing the popup.

(values) => {
User.addPaypalMeAddress(values.payPalMeUsername);
Growl.show(growlMessageOnSave, CONST.GROWL.SUCCESS, 3000);
Navigation.goBack(ROUTES.SETTINGS_WALLET);

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

We shall add following check for checking if new value is different.

    const setPayPalMeData = useCallback(
        (values) => {
            if (lodashGet(props.payPalMeData, 'accountData.username', '') !== values.payPalMeUsername) {
                User.addPaypalMeAddress(values.payPalMeUsername);
                Growl.show(growlMessageOnSave, CONST.GROWL.SUCCESS, 3000);
            }
            Navigation.goBack(ROUTES.SETTINGS_WALLET);
        },
        [growlMessageOnSave, props.payPalMeData],
    );

This way we are only calling save method if title is different and display the message if it's different.

What alternative solutions did you explore? (Optional)

@DylanDylann
Copy link
Contributor

Proposal

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

  • When user clicks 'Save' without changing their username "Your PayPal username was successfully saved" popup message appears

What is the root cause of that problem?

  • We are not checking if the previous value of the name is the same as the new value before submitting form:
    (values) => {
    User.addPaypalMeAddress(values.payPalMeUsername);
    Growl.show(growlMessageOnSave, CONST.GROWL.SUCCESS, 3000);
    Navigation.goBack(ROUTES.SETTINGS_WALLET);

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

  • Enable the user to click on the submit button without any action being performed in this case will confuse the user.
  • So when the input value is the same as the original value, we should disable the "Save PayPal account" button. We can do it by creating the getShouldDisableSubmit in App/src/pages/settings/Wallet/AddPayPalMePage.js like bellow:
    const getShouldDisableSubmit = useCallback(
        (values) => {
            if (lodashGet(props.payPalMeData, 'accountData.username', '') !== trim(values.payPalMeUsername) || isEmpty(trim(values.payPalMeUsername))) {
                return false;
            }

            return true;
        },
        [props.payPalMeData],
    );

  • Then pass it to the element and then propagate to the element in that form the know if we should disable the submit button

What alternative solutions did you explore? (Optional)

  • NA

Result

Screencast.from.07-09-2023.16.18.24.webm

@sophiepintoraetz
Copy link
Contributor

We are deprecating paypal (decision here, GH here) so closing this out, thanks!

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
Projects
None yet
Development

No branches or pull requests

5 participants