-
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
[PAID] [$250] Distance rate- WS owner can create multiple distance rate with same amount #51769
Comments
Triggered auto assignment to @strepanier03 ( |
@strepanier03 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 |
Edited by proposal-police: This proposal was edited at 2024-10-30 21:07:32 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Distance rate- WS owner can create multiple distance rate with same amount What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
const rateValueRegex = RegExp(String.raw`^-?\d{0,8}([${getPermittedDecimalSeparator(decimalSeparator)}]\d{0,${CONST.MAX_TAX_RATE_DECIMAL_PLACES}})?$`, 'i');
const ratesList = Object.values(customUnitRates);
if (ratesList.some((r) => r.rate === convertToBackendAmount(Number(parsedRate)))) {
errors.rate = Localize.translateLocal('common.error.invalidRateError');
} else if (!rateValueRegex.test(parsedRate) || parsedRate === '') {
errors.rate = Localize.translateLocal('common.error.invalidRateError');
} else if (NumberUtils.parseFloatAnyLocale(parsedRate) <= 0) {
errors.rate = Localize.translateLocal('common.error.lowRateError');
}
return errors;
const customUnitRates: Record<string, Rate> = useMemo(() => customUnit?.rates ?? {}, [customUnit]);
const validate = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.POLICY_CREATE_DISTANCE_RATE_FORM>) => {
return validateRateValue(values, currency, toLocaleDigit, customUnitRates);
},
[currency, toLocaleDigit, customUnitRates],
);
What alternative solutions did you explore? (Optional)Result |
@strepanier03 Huh... This is 4 days overdue. Who can take care of this? |
We chatted about this internally, and we want to block duplicate rates since the rate is the name and it's not possible to differentiate. We also block categories and tags of the same name so we'd want this similar to that. |
Job added to Upwork: https://www.upwork.com/jobs/~021854599760824128596 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @DylanDylann ( |
Working on determining the project now. |
We are unlikely to make any changes to this other than blocking the duplicate rate, but we will in the future most likely. |
This comment was marked as outdated.
This comment was marked as outdated.
Okay, we are good to move forward, here is the outcome.
Let's focus on not allowing duplicate rates within the same workspace in this GH and the other issue will be handled separately. |
@Krishna2323's proposal looks good to me 🎀 👀 🎀 C+ Reviewed |
Triggered auto assignment to @bondydaa, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@bondydaa Friendly bump |
@strepanier03 It seems @bondydaa is OOO |
@strepanier03 as mentioned here, @bondydaa is left and we need a new engineer to process this one. Could you help to unassign @bondydaa? |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.70-9 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 2024-12-11. 🎊 For reference, here are some details about the assignees on this issue:
|
@DylanDylann @strepanier03 @DylanDylann The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
@danieldoglas, @strepanier03, @Krishna2323, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@strepanier03 I think this is ready for payment. |
@danieldoglas, @strepanier03, @Krishna2323, @DylanDylann Huh... This is 4 days overdue. Who can take care of this? |
My apologies all, I was out for my anniversary and then got really sick. I'm taking care of this now. |
@DylanDylann can you please finish the checklist mentioned here? I can't pay out your contract until it's complete. |
Payment summary
|
@Krishna2323 - I've paid and closed your contract in Upwork. |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalPrecondition:Test:
Do we agree 👍 or 👎 |
@danieldoglas, @strepanier03, @Krishna2323, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@danieldoglas, @strepanier03, @Krishna2323, @DylanDylann 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
@Krishna2323 is this paid? Can we close it? |
@danieldoglas, @strepanier03, @Krishna2323, @DylanDylann Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it! |
Back from OoO. I've payed and closed the contract in Upwork for @DylanDylann and made the reg test. This is ready to close now. Thanks everyone! |
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: 9.0.55-9
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): testpayment935+523@gmail.com
Issue reported by: Applause - Internal Team
Action Performed:
Preconditions
Navigate to http://www.staging.new.expensify.com/
Steps
Expected Result:
Error shows as the rate is already exist
Actual Result:
WS owner can create multiple distance rate with same amount
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6650641_1730320405551.Screen_Recording_20241030_223334.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @strepanier03The text was updated successfully, but these errors were encountered: