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-06-13] [$1000] Console error on click of the paypal payment method where Make default payment method option isn’t available(Error: Invalid prop style supplied to Button) #19752

Closed
6 tasks
kavimuru opened this issue May 29, 2023 · 36 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

@kavimuru
Copy link

kavimuru commented May 29, 2023

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. Goto Settings -> Payments
  2. Click on paypal method
  3. Observe the console error in the devtools

Expected Result:

Console error should not be occurred

Actual Result:

Console error occurs

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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: needs reproduction
Reproducible in staging?: needs reproduction
Reproducible in production?: needs reproduction
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-05-18.at.10.04.14.PM.mov

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011825e5129fec9a46
  • Upwork Job ID: 1663730404176728064
  • Last Price Increase: 2023-05-31
@kavimuru kavimuru added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels May 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 29, 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

@kavimuru
Copy link
Author

Proposal by @Pujan92

Proposal

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

Console error on click of the paypal payment method where Make default payment method option isn’t available

What is the root cause of that problem?

For the button style we are passing the empty array here when default button option isn’t available for it, whereas in the button we are expecting style prop to be PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object])

style={[shouldShowMakeDefaultButton && styles.mt4]}

style: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]),

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

We need to pass an empty object either in the array or separately to fulfill the required prop types.

style={[shouldShowMakeDefaultButton ? styles.mt4 : {}]}

OR

style={shouldShowMakeDefaultButton ? styles.mt4 : {}}

@JmillsExpensify
Copy link

Not sure what's going on here and it's DEV so I'm going to go ahead and open this one up.

@JmillsExpensify JmillsExpensify added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels May 31, 2023
@melvin-bot melvin-bot bot changed the title Console error on click of the paypal payment method where Make default payment method option isn’t available(Error: Invalid prop style supplied to Button) [$1000] Console error on click of the paypal payment method where Make default payment method option isn’t available(Error: Invalid prop style supplied to Button) May 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011825e5129fec9a46

@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

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

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

melvin-bot bot commented May 31, 2023

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

@Web-Go-To
Copy link

Hello,
Based on the error message, it looks like there is an issue with how the style property is being used in the Button component. It is possible that the style property is being supplied an incorrect value type, or it has not been defined.
To fix this error, I can take the following steps:

  1. I will check the Button component's code implementation to ensure that the style property is defined as an object type. The style property value must be an object containing CSS style properties and values.
  2. I will check the usage of Button component is passing an object as the value of the style property. And I will ensure that the object supplied contains valid CSS style properties and values.
    For example:
<Button
  style={{ backgroundColor: 'blue', color: 'white', padding: '10px' }}
  onClick={handleClick}
>
  Click Me
</Button>

In the example above, the style property is being supplied with an object containing valid CSS style properties to apply the corresponding styling to the button.
3. I will check the React documentation on PropTypes and ensure that the correct type is defined in the Button component's prototype.

@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

📣 @Web-Go-To! 📣
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>

@Web-Go-To
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~0125148e869fb3679c

@melvin-bot
Copy link

melvin-bot bot commented May 31, 2023

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

@Web-Go-To
Copy link

Hello,
Based on the error message, it looks like there is an issue with how the style property is being used in the Button component. It is possible that the style property is being supplied an incorrect value type, or it has not been defined.
To fix this error, I can take the following steps:

I will check the Button component's code implementation to ensure that the style property is defined as an object type. The style property value must be an object containing CSS style properties and values.
I will check the usage of Button component is passing an object as the value of the style property. And I will ensure that the object supplied contains valid CSS style properties and values.
For example:
<Button
style={{ backgroundColor: 'blue', color: 'white', padding: '10px' }}
onClick={handleClick}

Click Me

In the example above, the style property is being supplied with an object containing valid CSS style properties to apply the corresponding styling to the button.
3. I will check the React documentation on PropTypes and ensure that the correct type is defined in the Button component's prototype.

@Web-Go-To
Copy link

Thank you for your message.

Based on the error message, it looks like there is an issue with how the style property is being used in the Button component. It is possible that the style property is being supplied an incorrect value type, or it has not been defined.

To fix this error, I can take the following steps:

  1. I will check the Button component's code implementation to ensure that the style property is defined as an object type. The style property value must be an object containing CSS style properties and values.

  2. I will check the usage of Button component is passing an object as the value of the style property. and I will ensure that the object supplied contains valid CSS style properties and values.

For example:

<Button
  style={{ backgroundColor: 'blue', color: 'white', padding: '10px' }}
  onClick={handleClick}
>
  Click Me
</Button>

In the example above, the style property is being supplied with an object containing valid CSS style properties to apply the corresponding styling to the button.

  1. I will check the React documentation on PropTypes and ensure that the correct type is defined in the Button component's prototype.

@mollfpr
Copy link
Contributor

mollfpr commented Jun 1, 2023

@NikkiWines the proposal from @Pujan92 looks good to me!

We can use the first option style={[shouldShowMakeDefaultButton ? styles.mt4 : {}]}.

🎀 👀 🎀 C+ reviewed!

@mollfpr
Copy link
Contributor

mollfpr commented Jun 1, 2023

I see that this is your first time try contributing here! You can start to go through the CONTRIBUTING.md and how to propose a solution.

@NikkiWines
Copy link
Contributor

NikkiWines commented Jun 1, 2023

Yep, agreed. @Pujan92's proposal looks good! 🚀

@Pujan92, i believe you need to comment in this issue before I can assign you to it 🙇

@Pujan92
Copy link
Contributor

Pujan92 commented Jun 2, 2023

@Pujan92, i believe you need to comment in this issue before I can assign you to it 🙇

Ok @NikkiWines , Done. I will raise a PR once it gets assigned to me. Thanks!

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

Pujan92 commented Jun 3, 2023

@mollfpr @NikkiWines PR is ready for review!

@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

🎯 ⚡️ Woah @mollfpr / @Pujan92, great job pushing this forwards! ⚡️

The pull request got merged within 2 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @Pujan92 got assigned: 2023-06-02 18:47:58 Z
  • when the PR got merged: 2023-06-06 17:20:40 UTC

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 Daily KSv2 labels Jun 6, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Console error on click of the paypal payment method where Make default payment method option isn’t available(Error: Invalid prop style supplied to Button) [HOLD for payment 2023-06-13] [$1000] Console error on click of the paypal payment method where Make default payment method option isn’t available(Error: Invalid prop style supplied to Button) Jun 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.24-5 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-06-13. 🎊

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

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 Jun 6, 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:

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

@JmillsExpensify
Copy link

@mollfpr we still have plenty of time, though ahead of the regression ending, would appreciate you checking off the items above. Thank you!

@mollfpr
Copy link
Contributor

mollfpr commented Jun 8, 2023

@JmillsExpensify yup, I will finish it today. Thanks for the reminder!

@mollfpr
Copy link
Contributor

mollfpr commented Jun 12, 2023

Sorry for the delay @JmillsExpensify 🙏

[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:

#13648

[@mollfpr] 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:

https://github.com/Expensify/App/pull/13648/files#r1226974514

[@mollfpr] 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:

Soon we will migrate to TS, which warns in the editor. Also, it should be caught while reviewing the PR.

[@mollfpr] Determine if we should create a regression test for this bug.

Yes!

[@mollfpr] 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.

  1. Goto Settings -> Payments
  2. Click on the Paypal method
  3. Verify there isn't any console error
  4. 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jun 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

@JmillsExpensify, @Pujan92, @NikkiWines, @mollfpr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@mollfpr
Copy link
Contributor

mollfpr commented Jun 20, 2023

Friendly bump @JmillsExpensify

@melvin-bot melvin-bot bot removed the Overdue label Jun 20, 2023
@Pujan92
Copy link
Contributor

Pujan92 commented Jun 22, 2023

Bump @JmillsExpensify :)

@melvin-bot melvin-bot bot added the Overdue label Jun 26, 2023
@JmillsExpensify
Copy link

Thanks guys! Sorry for the delay. Jumping in now.

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@JmillsExpensify
Copy link

Summarizing payments, this is what I'm seeing:

I've invited you both to the Upwork job. Bonuses will be paid out when payment is issue, with the offer now including the base.

@Pujan92
Copy link
Contributor

Pujan92 commented Jun 26, 2023

Thanks @JmillsExpensify , Accepted!

@JmillsExpensify
Copy link

Also, I disagree that we should add a regression test for console errors. I think this one is out of scope.

@JmillsExpensify
Copy link

@Pujan92 You're all set! I added the bonus on final payment.

@JmillsExpensify
Copy link

Alright, everyone has been paid out at this point and I don't think a regression test is in scope. Closing this issue out.

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

6 participants