Skip to content

[$250] Expense - Leading zeros are not removed when returning to amount input page #43243

Closed

Description

@kavimuru

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: 1.4.80-9
Reproducible in staging?: y
Reproducible in production?: n
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4592856
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Submit expense > Manual.
  3. Enter many zeros, then any digit > Next.
  4. Return to amount input page via back button.

Expected Result:

The leading zeros will be removed.

Actual Result:

The leading zeros are not removed.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6504348_1717705798824.20240607_041959.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d1b0565d440e64fb
  • Upwork Job ID: 1799101354337638448
  • Last Price Increase: 2024-06-07
  • Automatic offers:
    • hungvu193 | Reviewer | 102719101
    • abzokhattab | Contributor | 102719103
Issue OwnerCurrent Issue Owner: @hungvu193

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Jun 7, 2024
  2. melvin-bot commented on Jun 7, 2024

    @melvin-bot

    Triggered auto assignment to @sakluger (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.

  3. melvin-bot commented on Jun 7, 2024

    @melvin-bot

    Triggered auto assignment to @techievivek (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. github-actions commented on Jun 7, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. kavimuru commented on Jun 7, 2024

    @kavimuru
    Author

    @techievivek 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.

  6. kavimuru commented on Jun 7, 2024

    @kavimuru
    Author

    We think this bug might be related to #wave-collect - Release 1

  7. neonbhai commented on Jun 7, 2024

    @neonbhai
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Expense - Leading zeros are not removed when returning to amount input page

    What is the root cause of that problem?

    This happens as in the Submit Expense flow we access the IOU amount page from here:

    <IOURequestStepAmount route={route} />

    This does not have the shouldKeepUserInput prop passed to it.

    Since the prop is false by default:

    shouldKeepUserInput = false,

    The last param here is false, leading to the amount not being formatted.

    IOU.setMoneyRequestAmount(transactionID, amountInSmallestCurrencyUnits, currency || CONST.CURRENCY.USD, shouldKeepUserInput);

    What changes do you think we should make in order to solve the problem?

    Since <IOURequestStepAmount is only accessed from the IOURequestStartPage, we can simply have the prop true by default.

    shouldKeepUserInput = false,

    shouldKeepUserInput = false, 

    Alternatively

    • We can pass shouldKeepUserInput here

    • We should also consider renaming the prop to shouldFormatUserInput to better reflect what its doing

  8. 32 remaining items

  9. sakluger commented on Jun 14, 2024

    @sakluger
    Contributor

    Good call @hungvu193. I'll reassign @eVoloshchak as the C+.

  10. sakluger commented on Jun 14, 2024

    @sakluger
    Contributor

    Hey @abzokhattab - do you have a proposal or PR to fix this issue yet?

  11. abzokhattab commented on Jun 15, 2024

    @abzokhattab
    Contributor

    isn't this already the expected behavior according to #35797 (comment) and #34894 (comment)?

    cc @dangrous @eVoloshchak

  12. dangrous commented on Jun 18, 2024

    @dangrous
    Contributor

    So yeah this is currently expected behavior - to maintain user input in this flow. I could see us making an exception for leading zeros, but I don't think this should count as a regression.

    Basically our reasoning was that it's confusing if what you put in changed when you go back to it, and we do all the parsing afterwards. Again, this can be open for discussion, but shouldn't be a regression.

    We could also go the other route that Square Cash (and maybe others) take, and just disallow leading zeros from the beginning.

  13. sakluger commented on Jun 18, 2024

    @sakluger
    Contributor

    Thanks for clarifying @dangrous. I agree that we don't need to count this as a regression, but we should change the behavior to disallow leading zeros.

  14. sakluger commented on Jun 21, 2024

    @sakluger
    Contributor

    You know what - since this is the expected behavior at the moment, I'm going to close the issue for now. We can reopen later or open a new issue if we want to change the behavior.

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions