Skip to content

[C+ checklist needs completion] [$500] Web - User cannot edit the large amount after creating the distance #27255

Closed

Description

@kbecciv

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Set a big distance rate on a workspace (e.g.: 90000000)
  2. Request money -> distance
  3. Fill start and finish points
  4. Select that workspace
  5. Click on the requested money
  6. 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

big-rate.webm
Recording.4411.mp4

Expensify/Expensify Issue URL:
Issue reported by: @hichamcc
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694207504466369

View all open jobs on GitHub

Activity

  1. added
    External
    Daily
    Bug
    on Sep 12, 2023
  2. melvin-bot commented on Sep 12, 2023

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. 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
  4. melvin-bot commented on Sep 12, 2023

    @melvin-bot
  5. melvin-bot commented on Sep 12, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  6. added
    Help Wanted
    on Sep 12, 2023
  7. melvin-bot commented on Sep 12, 2023

    @melvin-bot

    Triggered auto assignment to @johncschuster (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

  8. melvin-bot commented on Sep 12, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (External)

  9. akinwale commented on Sep 12, 2023

    @akinwale
    Contributor

    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

    AMOUNT_MAX_LENGTH: 10,

    This is used in the MoneyRequestUtils#validateAmount method.

    return amount === '' || (decimalNumberRegex.test(amount) && calculateAmountLength(amount) <= CONST.IOU.AMOUNT_MAX_LENGTH);

    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)

    None.

  10. 54 remaining items

  11. greg-schroeder commented on Oct 12, 2023

    @greg-schroeder
    Contributor

    processing

  12. greg-schroeder commented on Oct 12, 2023

    @greg-schroeder
    Contributor

    @akinwale offer sent ($250)
    @jjcoffee offer sent ($250)
    @hichamcc offer sent ($50)

  13. 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
  14. akinwale commented on Oct 12, 2023

    @akinwale
    Contributor

    @akinwale offer sent ($250) @jjcoffee offer sent ($250) @hichamcc offer sent ($50)

    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

  15. jjcoffee commented on Oct 13, 2023

    @jjcoffee
    Contributor
    • 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

    1. Set a big distance rate on a workspace (e.g.: 90000000)
    2. Open FAB -> Request money -> Distance
    3. Set any start and finish points and continue
    4. Verify that the "Invalid amount" error shows

    Do we agree 👍 or 👎

  16. jjcoffee commented on Oct 13, 2023

    @jjcoffee
    Contributor

    @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 😄

  17. melvin-bot commented on Oct 16, 2023

    @melvin-bot

    @akinwale, @jjcoffee, @greg-schroeder, @aldo-expensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  18. greg-schroeder commented on Oct 16, 2023

    @greg-schroeder
    Contributor

    Okay I will review this either today or tomorrow

  19. greg-schroeder commented on Oct 19, 2023

    @greg-schroeder
    Contributor

    All right I agree @jjcoffee and @akinwale. I'll send over a new offer to account for the difference.

  20. greg-schroeder commented on Oct 19, 2023

    @greg-schroeder
    Contributor

    Filed regression test

  21. jjcoffee commented on Oct 19, 2023

    @jjcoffee
    Contributor

    @greg-schroeder Thanks - offer accepted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions