Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2022-05-20] [$1000] Workspace - Unable delete the unlimited numbers under rate in Reimburse expenses page #8309

Closed
kavimuru opened this issue Mar 24, 2022 · 43 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Reviewing Has a PR in review Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Mar 24, 2022

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. Go to https://staging.new.expensify.com/
  2. Log in with expensifail account
  3. Go to Setting - Workspace - Reimburse expenses
  4. Enter unlimited numbers and unlimited numbers after point
  5. Try to delete the numbers

Expected Result:

Limiting rate to 8 digits (before the decimal). We should still maintain 3 decimal places because that's the default IRS rate. E.g 12345678.123

Actual Result:

Unable to delete the numbers under rate in Reimburse expenses page

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.1.46.0

Reproducible in staging?: Y

Reproducible in production?: Y

Email or phone of affected tester (no customers): applausetester+0707abb@applause.expensifail.com / Feya87Katya

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos:

Bug5505054_Recording__115.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause

Slack conversation:

View all open jobs on GitHub

@melvin-bot
Copy link

melvin-bot bot commented Mar 24, 2022

Triggered auto assignment to @Gonals (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@parasharrajat
Copy link
Member

Lol. This is a good one. We didn't notice that the browser will use the e+ scientific number format.

@MelvinBot
Copy link

@Gonals Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@Gonals Gonals added Weekly KSv2 and removed Daily KSv2 labels Mar 29, 2022
@MelvinBot MelvinBot removed the Overdue label Mar 29, 2022
@Gonals Gonals added the External Added to denote the issue can be worked on by a contributor label Mar 29, 2022
@melvin-bot
Copy link

melvin-bot bot commented Mar 29, 2022

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 29, 2022
@Gonals
Copy link
Contributor

Gonals commented Mar 29, 2022

Looks like a pretty good issue! Setting as external and weekly

@Gonals Gonals removed their assignment Mar 29, 2022
@Gonals Gonals added the Improvement Item broken or needs improvement. label Mar 29, 2022
@kadiealexander
Copy link
Contributor

@parasharrajat
Copy link
Member

This is missing Exported label.

@melvin-bot
Copy link

melvin-bot bot commented Mar 31, 2022

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 31, 2022
@melvin-bot
Copy link

melvin-bot bot commented Mar 31, 2022

Triggered auto assignment to @pecanoro (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot changed the title Workspace - Unable delete the unlimited numbers under rate in Reimburse expenses page [$250] Workspace - Unable delete the unlimited numbers under rate in Reimburse expenses page Mar 31, 2022
@kadiealexander
Copy link
Contributor

Good catch, thanks @parasharrajat!

@parasharrajat
Copy link
Member

Please let us know the final expected behavior.

@trjExpensify
Copy link
Contributor

Cool, so I'd vote we go for limiting to 8 digits (before the decimal) like Request money. We still need to maintain 3 decimal places because that's the default IRS rate. E.g 12345678.123. Thoughts?

@izhan
Copy link
Contributor

izhan commented Apr 21, 2022

Yeah anything less than Number.MAX_INT (which is 9007199254740991) works, so 8 digits is reasonable! Best place IMO is putting it in the regex.

Out of curiosity - is there a reason we are correcting the value in the debounce function, and not in setRate when we set it? We already enforce the format on input using the regex, so as a user I was surprised that the UI formatted my input a 2nd time after a delay. Would it be better UX if we just consolidate all formatting logic to be on input only?

@parasharrajat
Copy link
Member

I am good with #8309 (comment). What do you think @pecanoro?

is there a reason we are correcting the value in the debounce function, and not in setRate when we set it?

So that users can type freely and modify the value if needed.

@pecanoro
Copy link
Contributor

Yes! It sounds good, I doubt the rate will go to anything closer to that ever, or at least I doubt we will be here to see it hahaha

@parasharrajat
Copy link
Member

Can someone update the Expected behavior with #8309 (comment)?

Accepting proposals now for the new behavior......

@izhan
Copy link
Contributor

izhan commented Apr 21, 2022

I'm somewhat new to this – I imagine I can just resubmit a proposal w/ a solution only (given I explained the problem above)?

Proposal

Solution

Change the regex we use in setRate to only limit to 8 characters. So changing this line:

RATE_VALUE: /^\d+(\.\d*)?$/,

to /^\d{1,8}(\.\d*)?$/

This has the intended behavior, as shown below
Screen Shot 2022-04-21 at 1 02 06 PM

Quick UX note: this makes the behavior more in line with that of Request Money, i.e. users cannot enter > 8 digits. We could alternatively add this check AFTER the setState (when we sent it to the server), but that leads to funky UX questions, i.e. how should we truncate long input? So IMO this is probably best, though open to other ideas

@parasharrajat
Copy link
Member

parasharrajat commented Apr 21, 2022

I am also confused to determine the best solution for this problem. we recently published some rules which restrict us from manipulating the user input.

Need help from @luacmartins to determine the best course here. 🙇

@luacmartins
Copy link
Contributor

@parasharrajat what part exactly do you need help with? I think it's fine to limit the rate to 8 digits before decimal and 3 decimal digits.

@parasharrajat
Copy link
Member

Ok, Thanks. I will review the proposal tomorrow.

@izhan
Copy link
Contributor

izhan commented Apr 27, 2022

Hey @parasharrajat - no rush, but just wanted to see if there's anything I can provide here!

@parasharrajat
Copy link
Member

Sorry, I was sick for few days past week. Looking into now.

@parasharrajat
Copy link
Member

@izhan's proposal is looking good.

cc: @pecanoro

🎀 👀 🎀 C+ reviewed

@pecanoro
Copy link
Contributor

@izhan What happens when you input more than 3 decimals? Because the original problem was that those decimals couldn't be removed and it seems the regex still let you input more than 3.

@izhan
Copy link
Contributor

izhan commented Apr 28, 2022

I think that was never an issue (here I'm adding >3 decimals on staging)

Screen.Recording.2022-04-28.at.11.57.46.AM.mov

I think the original issue was removing decimals of any large number that converted to scientific notation, which this PR should fix with the 8-digit limit

@pecanoro
Copy link
Contributor

Ohh you are right, the scientific notation was the issue here. Perfect, all good then, go ahead and apply for the job!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 28, 2022
@melvin-bot
Copy link

melvin-bot bot commented Apr 28, 2022

📣 @izhan You have been assigned to this job by @pecanoro!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@izhan
Copy link
Contributor

izhan commented Apr 30, 2022

PR is here #8838

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@kadiealexander kadiealexander changed the title [$1000] Workspace - Unable delete the unlimited numbers under rate in Reimburse expenses page [HOLD for payment 2022-05-20] [$1000] Workspace - Unable delete the unlimited numbers under rate in Reimburse expenses page May 17, 2022
@kadiealexander
Copy link
Contributor

@izhan - paid!
@parasharrajat - contract sent over, please let me know when you accept!

@parasharrajat
Copy link
Member

@kadiealexander Done.

@mallenexpensify mallenexpensify added the Awaiting Payment Auto-added when associated PR is deployed to production label May 20, 2022
@kadiealexander
Copy link
Contributor

All paid!! Thanks team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Improvement Item broken or needs improvement. Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests