-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Deploy Blocker] Changed max length to 11 for alignment issues #5243
Conversation
src/CONST.js
Outdated
@@ -362,7 +362,7 @@ const CONST = { | |||
PAYPAL_ME: 'PayPal.me', | |||
VENMO: 'Venmo', | |||
}, | |||
AMOUNT_MAX_LENGTH: 14, | |||
AMOUNT_MAX_LENGTH: 11, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented on the deploy blocker, but I think this needs to be 10, our backend shouldn't allow 11 digits (assuming we use the name amount
for the parameter when calling the API)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sorry, small correction. The max is 10 digits when given amount is in cents. So for example you can use enter:
$12345678.91
because 12345678.91 * 100 = 1234567891
and is 10 digits, but you cannot enter the amount 1234567890
, because 1234567890 * 100 = 123456789000
is 12 digits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I've updated the PR to 10 digits now.
@francoisl I've updated the PR with the 10 digit check. But I am not sure how to add tests (I've never done that earlier). Can you help with this and I'll add those. |
@@ -362,7 +362,7 @@ const CONST = { | |||
PAYPAL_ME: 'PayPal.me', | |||
VENMO: 'Venmo', | |||
}, | |||
AMOUNT_MAX_LENGTH: 14, | |||
AMOUNT_MAX_LENGTH: 10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as I explained here, we always use amounts in cents in the Expensify backend, so if for example you type $1.23
, then we use the amount 123
. If you type $20
, then we send 2000
.
The amount in cents is what needs to be 10 digits max, so we need to multiply the amount to check in validateAmount()
by 100 first.
Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I somehow misunderstood. I've updated the PR with the new cent logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you asking me to add a test case to an existing one? or are you asking me to write a fresh new unit test case? Can you please confirm? |
No - just in the QA steps section, update the instructions to say to complete the entire flow, so:
But I tested on my end and it's working. |
Update the QA steps. Thanks a lot, @francoisl for your help. |
|
[Deploy Blocker] Changed max length to 11 for alignment issues (cherry picked from commit 09dd0bf)
@francoisl @akshayasalvi We're able to use 11 digits with decimals instead of 10 |
Ah, good catch. It only works if the last digit is |
Great then! We can check this off 🎉 |
I had explicitly tested |
This has been deployed to production and is now subject to a 7-day regression period. |
🚀 Cherry-picked to staging by @francoisl in version: 1.0.98-1 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by @francoisl in version: 1.0.98-1 🚀
|
🚀 Deployed to staging by @francoisl in version: 1.0.98-2 🚀
|
@deetergp @marcaaron or anybody can review and merge this on priority?
Details
Fixed Issues
$ #5241
$ #5115
Tests
QA Steps
Tested On
Screenshots
Web
Screen.Recording.2021-09-15.at.12.00.58.AM.mov
Mobile Web
Updated with 10 digits
https://user-images.githubusercontent.com/57435789/133314295-be399ca0-63ad-4089-939f-d45d6e9f1cfb.mov
Desktop
iOS
Android