-
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 2024-08-01] [$250] Subscription size - Decimal point can be inserted and not removed on the confirmation page #43796
Comments
Triggered auto assignment to @miljakljajic ( |
@miljakljajic 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.Subscription size - Decimal point can be inserted and not removed on the confirmation page What is the root cause of that problem?We haven't added a check for decimal point. App/src/libs/ValidationUtils.ts Lines 485 to 488 in 75c104b
What changes do you think we should make in order to solve the problem?Check if the number contains function isValidSubscriptionSize(subscriptionSize: string): boolean {
const parsedSubscriptionSize = Number(subscriptionSize);
if (subscriptionSize.includes('.')) {
return false;
}
return !Number.isNaN(parsedSubscriptionSize) && parsedSubscriptionSize > 0 && parsedSubscriptionSize <= CONST.SUBSCRIPTION_SIZE_LIMIT && Number.isInteger(parsedSubscriptionSize);
} What alternative solutions did you explore? (Optional)We can use function isValidSubscriptionSize(subscriptionSize: string): boolean {
const parsedSubscriptionSize = Number(subscriptionSize);
return (
!Number.isNaN(parsedSubscriptionSize) &&
parsedSubscriptionSize > 0 &&
parsedSubscriptionSize <= CONST.SUBSCRIPTION_SIZE_LIMIT &&
Number.isInteger(parsedSubscriptionSize) &&
CONST.REGEX.NUMBER.test(subscriptionSize)
);
} What alternative solutions did you explore? (Optional 2)If we don't want to show error when entering 0 after decimal then we need to trim the decimal points on confirmation page.
title={translate('subscription.subscriptionSize.activeMembers', {
size: subscriptionSizeFormDraft ? `${Math.trunc(Number(subscriptionSizeFormDraft[INPUT_IDS.SUBSCRIPTION_SIZE]))}` : 0,
})} Additionally we should also clear the draft value when saving the subscription size. App/src/pages/settings/Subscription/SubscriptionSize/index.tsx Lines 29 to 32 in 75c104b
To: const onFinished = () => {
FormActions.clearDraftValues(ONYXKEYS.FORMS.SUBSCRIPTION_SIZE_FORM);
Subscription.updateSubscriptionSize(subscriptionSizeFormDraft ? Number(subscriptionSizeFormDraft[INPUT_IDS.SUBSCRIPTION_SIZE]) : 0, privateSubscription?.userCount ?? 0);
Navigation.goBack();
}; |
Proposal Updated
|
@miljakljajic Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Job added to Upwork: https://www.upwork.com/jobs/~01d8c409a169a06c82 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
@Krishna2323 In my opinion, the correct solution would be the alternative option 2, which involves making updates to the confirmation page. We can make a small improvement by extracting the size draft value, formatting it, and then using it in the component. const subscriptionSizeDraft = Number(subscriptionSizeFormDraft[INPUT_IDS.SUBSCRIPTION_SIZE]) @Krishna2323's Alternative solution option 2 looks good to me 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @AndrewGable, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @fedirjh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @Krishna2323 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@Krishna2323 when can we expect a PR? |
Will raise the PR today. |
@fedirjh PR ready for review ^ |
PR merged. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.11-5 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-08-01. 🎊 For reference, here are some details about the assignees on this 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:
|
@Krishna2323 you've been paid in upwork, thank you! @fedirjh your original offer expired as you didn't accept it in upwork in time. Please accept the new offer. |
actually @fedirjh do we pay you in NewDot? I noticed you're listed for manual payments. Let me know and I'll provide a payment summary instead. |
@miljakljajic Yes, that’s correct. Can you provide a summary instead? Thank you |
BugZero Checklist:
|
Of course, apologies. @fedirjh is owed 250 for their work reviewing this issue. |
$250 approved for @fedirjh |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.84-0
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
Issue found when executing PR #43328
Action Performed:
Expected Result:
Decimal point will be removed on the next page
Actual Result:
Decimal point can be inserted and not removed on the confirmation page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6514089_1718444363848.bandicam_2024-06-15_17-37-25-460.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @miljakljajicThe text was updated successfully, but these errors were encountered: