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
[$250] Expense - Leading zeros are not removed when returning to amount input page #43243
👋 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:
Identify the pull request that introduced this issue and revert it.
@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.
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.
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.
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.
Activity
melvin-bot commentedon Jun 7, 2024
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.melvin-bot commentedon Jun 7, 2024
Triggered auto assignment to @techievivek (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon Jun 7, 2024
👋 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:
kavimuru commentedon Jun 7, 2024
@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.
kavimuru commentedon Jun 7, 2024
We think this bug might be related to #wave-collect - Release 1
neonbhai commentedon Jun 7, 2024
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:
App/src/pages/iou/request/IOURequestStartPage.tsx
Line 166 in 1426c4e
This does not have the
shouldKeepUserInputprop passed to it.Since the prop is
falseby default:App/src/pages/iou/request/step/IOURequestStepAmount.tsx
Line 74 in 1426c4e
The last param here is
false, leading to the amount not being formatted.App/src/pages/iou/request/step/IOURequestStepAmount.tsx
Line 171 in 1426c4e
What changes do you think we should make in order to solve the problem?
Since
<IOURequestStepAmountis only accessed from theIOURequestStartPage, we can simply have the prop true by default.App/src/pages/iou/request/step/IOURequestStepAmount.tsx
Line 74 in 1426c4e
Alternatively
We can pass
shouldKeepUserInputhereWe should also consider renaming the prop to
shouldFormatUserInputto better reflect what its doing32 remaining items
sakluger commentedon Jun 14, 2024
Good call @hungvu193. I'll reassign @eVoloshchak as the C+.
sakluger commentedon Jun 14, 2024
Hey @abzokhattab - do you have a proposal or PR to fix this issue yet?
abzokhattab commentedon Jun 15, 2024
isn't this already the expected behavior according to #35797 (comment) and #34894 (comment)?
cc @dangrous @eVoloshchak
dangrous commentedon Jun 18, 2024
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.
sakluger commentedon Jun 18, 2024
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.
sakluger commentedon Jun 21, 2024
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.