You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] mWeb - IOU - Creating a split expense with IQD currency & 10 digit amount unexpected error shown #42084
Version Number: 1.4.73 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/4554848 Issue reported by: Applause - Internal Team
Create a split expense with IQD currency and 10 digit amount 2000000000
Expected Result:
If 10 digit amount are not allowed, user must not be allowed to create expense. If user allowed to create expense, then unexpected error must not be shown
Actual Result:
Creating a split expense with IQD currency & 10 digit amount unexpected error displayed
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
@trjExpensify 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
In calculateAmountLength, we multiply the amount with 10 to the power of the number of decimals allowed on a currency. So, if the currency allows 2 decimals, then it will be multiplied by 100, that's why we can only input 8 digit length for currency like USD. But if the currency doesn't allow decimal, such as IQD, then we can input 10 digit length.
The wrong length calculation logic is changed in #34849
What changes do you think we should make in order to solve the problem?
Always multiply the amount with 100 to convert it to cents instead of depending on the decimals allowed on a currency, just like what we did for the first time in #5243.
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.81-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve 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:
[@ikevin127] The PR that introduced the bug has been identified. Link to the PR:
[@ikevin127] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@ikevin127] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@ikevin127] Determine if we should create a regression test for this bug.
[@ikevin127] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve 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:
[@ikevin127] The PR that introduced the bug has been identified. Link to the PR:
[@ikevin127] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@ikevin127] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@ikevin127] Determine if we should create a regression test for this bug.
[@ikevin127] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
[@ikevin127] The PR that introduced the bug has been identified. Link to the PR: #34849.
[@ikevin127] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: #34849 (comment).
[@ikevin127] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
[@ikevin127] Determine if we should create a regression test for this bug.
[@ikevin127] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
Regression Test Proposal
Open the FAB menu.
Create a Split expense and select the IQD currency.
Verify that we cannot enter an amount with more than 8 digits. (e.g. 12345678)
Submit the Split expense.
Verify that the expense request is submitted successfully without any errors being shown.
⚠️ Not sure why the automation added the second HOLD date her, since the PR was deployed 4 days ago according to #42815 (comment) -> therefore the [HOLD for payment 2024-06-18] is the correct payment date.
Summary:
1st PR was reverted due to regression -> no compensation due for contributor / reviewer
2nd PR was deployed to production 4 days ago -> compensation due for contributor / reviewer on 2024-06-18
Activity
melvin-bot commentedon May 13, 2024
Triggered auto assignment to @trjExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.lanitochka17 commentedon May 13, 2024
@trjExpensify 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
lanitochka17 commentedon May 13, 2024
We think that this bug might be related to #vip-split
bernhardoj commentedon May 14, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Creating a new expense with a 10 digit gives an unexpected error.
What is the root cause of that problem?
This issue not only happens with IQD currency but with any currency that has no decimals, such as JPY. We are validating the amount length here,
App/src/libs/MoneyRequestUtils.ts
Lines 58 to 64 in f8a30a1
and the default max length is 10.
App/src/CONST.ts
Line 1557 in f8a30a1
We calculate the amount length using
calculateAmountLengthfunction.App/src/libs/MoneyRequestUtils.ts
Lines 43 to 46 in f8a30a1
In
calculateAmountLength, we multiply the amount with 10 to the power of the number of decimals allowed on a currency. So, if the currency allows 2 decimals, then it will be multiplied by 100, that's why we can only input 8 digit length for currency like USD. But if the currency doesn't allow decimal, such as IQD, then we can input 10 digit length.However, in the BE, all amounts are in cent, so the 10-digit length will be 12 digit length, and BE will return an error for it.
The wrong length calculation logic is changed in #34849
What changes do you think we should make in order to solve the problem?
Always multiply the amount with 100 to convert it to cents instead of depending on the decimals allowed on a currency, just like what we did for the first time in #5243.
trjExpensify commentedon May 15, 2024
Whoops, slipped through the cracks. I agree there should be front-end validation to match here.
[-]mWeb - IOU - Creating a split expense with IQD currency & 10 digit amount unexpected error shown[/-][+][$250] mWeb - IOU - Creating a split expense with IQD currency & 10 digit amount unexpected error shown[/+]melvin-bot commentedon May 15, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01894cc4ac52447ce7
60 remaining items
melvin-bot commentedon Jun 11, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.81-11 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-06-18. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 11, 2024
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:
[-][HOLD for payment 2024-06-18] [$250] mWeb - IOU - Creating a split expense with IQD currency & 10 digit amount unexpected error shown[/-][+][HOLD for payment 2024-06-20] [HOLD for payment 2024-06-18] [$250] mWeb - IOU - Creating a split expense with IQD currency & 10 digit amount unexpected error shown[/+]melvin-bot commentedon Jun 13, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 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-06-20. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 13, 2024
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:
ikevin127 commentedon Jun 15, 2024
Regression Test Proposal
IQDcurrency.Do we agree 👍 or 👎.
ikevin127 commentedon Jun 18, 2024
Summary:
cc @trjExpensify
trjExpensify commentedon Jun 19, 2024
Not sure where 4 days ago is coming from, but if we're talking about these two PRs (1, 2), I agree it's due for payment now.
Confirming that as follows:
Let me know if I'm missing something, and I'll settle up with you both once confirmed.
trjExpensify commentedon Jun 19, 2024
Cool, settled up!