-
Notifications
You must be signed in to change notification settings - Fork 3k
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-09-04] [$1000] Reimburse - 0.5 is allowed, but .5 is not allowed #25514
Comments
ProposalPlease re-state the problem that we are trying to solve in this issue.0.5 is allowed, but .5 is not allowed in the rate field. What is the root cause of that problem?In the regex used, we explicitly ask for at least one digit to be present on the left side of the decimal. Thus, we cannot use
What changes do you think we should make in order to solve the problem?We should change the regex to be this to ensure that if there is no digit on the left hand side, it automatically counts as 0: Having this change wouldn't impact the server as we already add the 0 to the left of the decimal here:
What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.0.5 is allowed, but .5 is not allowed What is the root cause of that problem?We use this regex to validate the rate and It does not allow before the dot without any number App/src/pages/workspace/reimburse/WorkspaceRateAndUnitPage.js Lines 96 to 97 in 0bdf183
What changes do you think we should make in order to solve the problem?We should change the regex to allow the rate that doesn't contain digit before the dot
App/src/pages/workspace/reimburse/WorkspaceRateAndUnitPage.js Lines 96 to 97 in 0bdf183
What alternative solutions did you explore? (Optional) |
Triggered auto assignment to @bfitzexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.When entering a rate for reimbursement, the value "0.5" is accepted, but ".5" is not. The system throws a validation error for ".5", even though it should be considered a valid rate. What is the root cause of that problem?The root cause is the regular expression used for validation in the WorkspaceRateAndUnitPage.js file. The current regex expects at least one digit before the decimal separator, which is why ".5" is not considered valid. App/src/pages/workspace/reimburse/WorkspaceRateAndUnitPage.js Lines 93 to 101 in 3d07591
What changes do you think we should make in order to solve the problem?We need to modify the regex to allow for values that don't have a digit before the decimal separator. The updated regex should be: const rateValueRegex = RegExp(String.raw`^(\d{0,8}[${getPermittedDecimalSeparator(decimalSeparator)}]\d{1,3})?$`, 'i'); This change will ensure that both ".5" and "0.5" are considered valid rate values. Result:2023-08-18.23-05-52.mp4What alternative solutions did you explore? (Optional) |
Is that really a bug, it's a bit different but when we did that page they said saving |
@bfitzexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
To me, |
Job added to Upwork: https://www.upwork.com/jobs/~01db7922b3ba7a8491 |
Triggered auto assignment to @conorpendergrast ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 ( |
@cubuspl42 we have a couple of proposals already ready for review when you get a chance - thanks! @conorpendergrast I'm heading ooo for a week, will leave myself assigned and can take this back over upon my return |
The proposal by @GItGudRatio seems to solve the problem cleanly and their bot was the fastest. Other proposals look similar. C+ reviewed 🎀 👀 🎀 |
Triggered auto assignment to @amyevans, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@cubuspl42 Should we add a empty check after we change the regex to prevent the user save rate with an empty string.? |
@dukenv0307 I decided to postpone the heavy regex testing, including the corner cases, to the implementation phase. I definitely agree that handling corner cases is important. |
PR is up for review, kindly review! |
📣 @Premsjce We're missing your Upwork ID to automatically send you an offer for the Reporter role. |
@MelvinBot |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
🎯 ⚡️ Woah @cubuspl42 / @GItGudRatio, great job pushing this forwards! ⚡️ The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.57-6 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-09-04. 🎊 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.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
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:
|
|
👋 @bfitzexpensify @conorpendergrast, can you reduce the payment for @cubuspl42 by 50% when you pay this please? We missed a regression here and I already settled up. Thanks! |
Sure Tom, thanks for that. Added into this comment #25514 (comment) |
@bfitzexpensify @conorpendergrast : |
@trjExpensify @conorpendergrast |
@cubuspl42 Ah, I believe the deduction should be $1000. Here's my maths:
|
@Premsjce offer sent now, thanks for applying on the job! |
@conorpendergrast : thank you.. accepted the offer in upwork, now the status is contract started. |
I'll pay today and then close out the contract, you don't need to do anything else here! |
Payouts due:
Eligible for 50% #urgency bonus? Yes Upwork job is here. All done, thanks everyone. Closing out! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
.5 is valid rate, should not throw error
Actual Result:
Throws error
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.55-7
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
RPReplay_Final1691592659.1.MP4
Desktop.2023.08.18.-.17.10.07.01.1.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Premsjce
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691592935896589
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: