-
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
Fix user can submit 10-digit amount and gives an unexpected error #42426
Fix user can submit 10-digit amount and gives an unexpected error #42426
Conversation
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@@ -40,10 +40,10 @@ function addLeadingZero(amount: string): string { | |||
/** | |||
* Calculate the length of the amount with leading zeroes | |||
*/ | |||
function calculateAmountLength(amount: string, decimals: number): number { |
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.
@bernhardoj Got a type error here since you removed decimals
but still passing 2 arguments down in the validateAmount
function return.
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.
Fixed
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromeandroid-mweb.moviOS: Nativeios.moviOS: mWeb Safariios-mweb.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
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.
LGTM and tests well 👍
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.4.77-0 🚀
|
[CP Staging] Revert "Merge pull request #42426 from bernhardoj/fix/42084-limi-amount-to-8-digit"
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.77-11 🚀
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.4.77-11 🚀
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.4.77-11 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.77-11 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.78-5 🚀
|
Details
When we select a currency without decimals, we can input up to 10 digit of amount which leads to a BE error. This PR fix it.
Fixed Issues
$ #42084
PROPOSAL: #42084 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-05-21.at.22.51.32.1.mov
Android: mWeb Chrome
Screen.Recording.2024-05-21.at.22.49.34.mov
iOS: Native
Screen.Recording.2024-05-21.at.22.52.23.1.mov
iOS: mWeb Safari
Screen.Recording.2024-05-21.at.22.55.05.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-21.at.22.40.12.mov
MacOS: Desktop
Screen.Recording.2024-05-21.at.22.41.23.mov