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
[C+ checklist needs completion] [$500] Web - User cannot edit the large amount after creating the distance #27255
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Set a big distance rate on a workspace (e.g.: 90000000)
Request money -> distance
Fill start and finish points
Select that workspace
Click on the requested money
Click on Amount
Expected Result:
The user should be able to edit the Amount
Actual Result:
User cannot edit the large amount after creating the distance
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.68.12 Reproducible in staging?: y Reproducible in production?: y 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
changed the title [-]Web - User cannot edit the large amount after creating the distance[/-][+][$500] Web - User cannot edit the large amount after creating the distance[/+]on Sep 12, 2023
Please re-state the problem that we are trying to solve in this issue.
User cannot edit large amounts after creating the distance.
What is the root cause of that problem?
There is a max length limit enforced on the input field in MoneyRequestAmountForm which prevents the ability to edit amounts greater than that limit. The current max length is 10 as defined in the app constants.
What changes do you think we should make in order to solve the problem?
Solution 1
Increase the max length limit for the input field.
Solution 2
Set a maximum limit on the amount that a distance request can be. This maximum limit cannot be more than the allowed limit in the MoneyRequestAmountForm. If the amount is greater than this limit, do not allow the user to proceed. Either display a client-side validation error, or validate on the backend and return an error.
In this case, the maximum amount limit would be 99,999,999.99, taking into account the fact that the amounts could have 2 decimal places.
Alternatively, just use the MoneyRequestUtils#validateAmount method (or just calculateAmountLength - we have to add this to the exports in MoneyRequestUtils) to check the amount and display a validation error in the distance request flow.
Solution 3
Set a maximum limit on the distance rate. This will still need to be combined with Solution 2.
What alternative solutions did you explore? (Optional)
changed the title [-][HOLD for payment 2023-10-12] [HOLD for payment 2023-10-10] [$500] Web - User cannot edit the large amount after creating the distance[/-][+][C+ checklist needs completion] [$500] Web - User cannot edit the large amount after creating the distance[/+]on Oct 12, 2023
The regression that happened here couldn't have been caught during testing because it was due to a separate PR that was merged at the same time. Would the penalty still apply in this case?
The PR that introduced the bug has been identified. Link to the PR: N/A - behaviour was always there
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: N/A
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
Determine if we should create a regression test for this bug. Yes
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
Set a big distance rate on a workspace (e.g.: 90000000)
Also agree with @akinwale - the regression penalty isn't meant to be applied if the review checklist was completed properly (per the C+ process doc at least!). The other PR could also be argued to have caused the regression since it was merged later than our one 😄
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Sep 12, 2023
Triggered auto assignment to @greg-schroeder (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.[-]Web - User cannot edit the large amount after creating the distance[/-][+][$500] Web - User cannot edit the large amount after creating the distance[/+]melvin-bot commentedon Sep 12, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0155a08bb4447cde17
melvin-bot commentedon Sep 12, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Sep 12, 2023
Triggered auto assignment to @johncschuster (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.melvin-bot commentedon Sep 12, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)akinwale commentedon Sep 12, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
User cannot edit large amounts after creating the distance.
What is the root cause of that problem?
There is a max length limit enforced on the input field in MoneyRequestAmountForm which prevents the ability to edit amounts greater than that limit. The current max length is 10 as defined in the app constants.
App/src/CONST.ts
Line 1059 in 2163c54
This is used in the
MoneyRequestUtils#validateAmountmethod.App/src/libs/MoneyRequestUtils.js
Line 61 in 2163c54
What changes do you think we should make in order to solve the problem?
Solution 1
Increase the max length limit for the input field.
Solution 2
Set a maximum limit on the amount that a distance request can be. This maximum limit cannot be more than the allowed limit in the MoneyRequestAmountForm. If the amount is greater than this limit, do not allow the user to proceed. Either display a client-side validation error, or validate on the backend and return an error.
In this case, the maximum amount limit would be
99,999,999.99, taking into account the fact that the amounts could have 2 decimal places.Alternatively, just use the
MoneyRequestUtils#validateAmountmethod (or justcalculateAmountLength- we have to add this to the exports inMoneyRequestUtils) to check the amount and display a validation error in the distance request flow.Solution 3
Set a maximum limit on the distance rate. This will still need to be combined with Solution 2.
What alternative solutions did you explore? (Optional)
None.
54 remaining items
greg-schroeder commentedon Oct 12, 2023
processing
greg-schroeder commentedon Oct 12, 2023
@akinwale offer sent ($250)
@jjcoffee offer sent ($250)
@hichamcc offer sent ($50)
[-][HOLD for payment 2023-10-12] [HOLD for payment 2023-10-10] [$500] Web - User cannot edit the large amount after creating the distance[/-][+][C+ checklist needs completion] [$500] Web - User cannot edit the large amount after creating the distance[/+]akinwale commentedon Oct 12, 2023
The regression that happened here couldn't have been caught during testing because it was due to a separate PR that was merged at the same time. Would the penalty still apply in this case?
cc @aldo-expensify
jjcoffee commentedon Oct 13, 2023
Regression Test Proposal
Do we agree 👍 or 👎
jjcoffee commentedon Oct 13, 2023
@greg-schroeder Checklist complete!
Also agree with @akinwale - the regression penalty isn't meant to be applied if the review checklist was completed properly (per the C+ process doc at least!). The other PR could also be argued to have caused the regression since it was merged later than our one 😄
melvin-bot commentedon Oct 16, 2023
@akinwale, @jjcoffee, @greg-schroeder, @aldo-expensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
greg-schroeder commentedon Oct 16, 2023
Okay I will review this either today or tomorrow
greg-schroeder commentedon Oct 19, 2023
All right I agree @jjcoffee and @akinwale. I'll send over a new offer to account for the difference.
greg-schroeder commentedon Oct 19, 2023
Filed regression test
jjcoffee commentedon Oct 19, 2023
@greg-schroeder Thanks - offer accepted!