-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 5-16][$250] Distance rate - Value ending with decimal point in distance rate editor is not accepted #40946
Comments
Triggered auto assignment to @Christinadobrzyn ( |
We think that this bug might be related to #wave-collect - Release 1 |
@Christinadobrzyn FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
ProposalPlease re-state the problem that we are trying to solve in this issue.Validation fails for values with only decimal pointer and no digits after that. What is the root cause of that problem?For distance rates, We have a validation function which calls
This validation function has a regex which doesn't allow us to have a value with only decimal point and no digit after that, this causes the validation logic to fail: App/src/libs/PolicyDistanceRatesUtils.ts Line 18 in 9a727de
What changes do you think we should make in order to solve the problem?We need to update the regex to: const rateValueRegex = RegExp(String.raw`^-?\d{0,8}([${getPermittedDecimalSeparator(decimalSeparator)}]\d{0,${CurrencyUtils.getCurrencyDecimals(currency) + 1}})?$`, 'i'); Well update What alternative solutions did you explore? (Optional)
|
I think this might be vsb-split (as I see other BZ Distance GHs linked to that project). Let's see if this can be external |
Job added to Upwork: https://www.upwork.com/jobs/~010c566adc64c516d8 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ikevin127 ( |
However, I'm also wondering if we want to fix this as explained in the OP or if we want to throw an error. Do we want users to be able to enter a "3." value? Asking the team what we want as an expected behaviour - https://expensify.slack.com/archives/C05RECHFBEW/p1714115140280529 |
@Christinadobrzyn , we allow the user to enter values like Screen.Recording.2024-04-26.at.1.19.10.PM.mov(We also allow the values like |
♻️ Reviewing proposal. @Christinadobrzyn Please let me know what the team decided based on #40946 (comment), as I don't have access to the Slack 🧵. |
@GandalfGwaihir's proposal looks good to me. The RCA was correctly identified and the proposed solution fixes the issue accordingly. 🎀👀🎀 C+ reviewed @lakchote Let's hold assignment until @Christinadobrzyn confirms whether we should go with this fix according to Slack discussion mentioned in #40946 (comment). |
Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
nudging the team for some thoughts - https://expensify.slack.com/archives/C05RECHFBEW/p1714384313394889 |
Looks like we want for consistency to treat cases where we're ending with a decimal as 0, can you confirm? |
Thanks @lakchote - yes that's my understanding. A user should be able to enter a number (aka amount) ending with a decimal without error. Thank you! |
📣 @ikevin127 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @GandalfGwaihir 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR ready for review c.c. @ikevin127 |
reviewing PR - #41503 |
|
Payouts due:
Upwork job is here. We'll pay this in a few days! Do we need a regression test? |
Paid out based on this payment summary. I assume we'll create a regression test for this at the end of the polish process? @lakchote? |
Regression Test ProposalPreconditions: We need to have a Collect workspace with Distance rates enabled.
Do we agree 👍 or 👎. |
Regression test - https://github.com/Expensify/Expensify/issues/397047 Payment summary here - #40946 (comment) Closing as complete! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.65-5
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
The value ending with decimal point in distance rate editor should be accepted
Actual Result:
The value ending with decimal point in distance rate editor is not accepted
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6460730_1713988278794.20240425_034651.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: