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

[Teams] Fix quantity type conversion #3866

Merged
merged 1 commit into from
Apr 9, 2021
Merged

[Teams] Fix quantity type conversion #3866

merged 1 commit into from
Apr 9, 2021

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Apr 9, 2021

Fixes #3865

Explanation:

  • element.value is always a string in HTML
  • When we select a non-default value from the Team Plan Seat quantity selector, it changes quantity to a string in the React state
  • Somewhere in checkout, something like newQuantity = originalQuantity + extraQuantity happens -- when extraQuantity is a string, it coerces originalQuantity to a string, and then just appends the extra digits

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Apr 9, 2021

Waiting on https://werft.gitpod-io-dev.com/job/gitpod-build-jx-fix-teams.0 to validate the fix

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Apr 9, 2021

How to test:

  1. In https://jx-fix-teams.staging.gitpod-io-dev.com/teams create a new Team Plan with 10 Members
  2. Go through billing (tip: pick the proposed fake credit card)
  3. Once the "payment" is through, add another 10 Members to the Team Plan
  4. Once the second "payment" is through, it should show 20 Members
  5. When you click on Billing, it should also show Team ... x 20, not Team ... x 1010(!)

@jankeromnes jankeromnes marked this pull request as ready for review April 9, 2021 10:44
Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the catch!

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Apr 9, 2021

Thanks! Found a second, similar occurrence of setQuantity (when you create a team). Probably benign but fixing as well.

@jankeromnes jankeromnes removed the request for review from meysholdt April 9, 2021 10:56
@jankeromnes jankeromnes merged commit 055115b into main Apr 9, 2021
@jankeromnes jankeromnes deleted the jx/fix-teams branch April 9, 2021 11:02
@gtsiolis
Copy link
Contributor

gtsiolis commented Apr 9, 2021

Thanks for fixing this @jankeromnes! 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in team billing
3 participants