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

Requesting amount 0 (or less than two decimal) shows undefined URL. #3568

Closed
5 tasks done
rushatgabhane opened this issue Jun 12, 2021 · 10 comments
Closed
5 tasks done
Assignees
Labels
Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@rushatgabhane
Copy link
Member

rushatgabhane commented Jun 12, 2021

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


Expected Result:

Requesting 0 shouldn't be allowed. (Leads to unnecessary API call)

Actual Result:

Request of 0 amount is allowed and redirects to e.cash/r/undefined

Expensify.cash.-.Google.Chrome.2021-06-12.18-33-56.mp4

Action Performed:

  1. Request money
  2. Set amount as 0 or 0.001
  3. Confirm request.

Workaround:

Not needed.

Platform:

Where is this issue occurring?

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

Version Number:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:

View all open jobs on Upwork

@rushatgabhane rushatgabhane added the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Jun 12, 2021
@MelvinBot
Copy link

Triggered auto assignment to @jboniface (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Jun 12, 2021
@rushatgabhane
Copy link
Member Author

Couldn't find related open issue.

Proposal

The next button should be disabled if amount is less than 0.01.

@jasperhuangg
Copy link
Contributor

Hey @rushatgabhane!

I do agree that the next button should be disabled, but only if the amount is less than or equal to 0, not if it's less than 0.01. I'm not entirely sure, but I think this is still a valid amount to request. If your concern is requesting amounts less than 1 cent, then users would still be able to request amounts like 0.015 etc.

Can you provide more of an explanation as to how you would like to achieve this?

@rushatgabhane
Copy link
Member Author

Hi @jasperhuangg !
Amount 0.015 doesn't have this issue.
Anything less than 1 cent is a problem.

This is the network request that I tracked.

Request for 0.001, API.CreateIOUTransaction returns 405 Invalid amount
https://www.expensify.com/api?command=CreateIOUTransaction
image

Solution

We can simply check for amount > 0.001 in isDisabled.

// IOUAmountPage.js line 187
<Button
    isDisabled={this.state.amount.length === 0}
    ...
/>

@jasperhuangg
Copy link
Contributor

Looks good to me, feel free to get started!

@rushatgabhane
Copy link
Member Author

rushatgabhane commented Jun 17, 2021

Can you please send job link to apply so that I can create a pull request?

@jasperhuangg jasperhuangg added External Added to denote the issue can be worked on by a contributor and removed Engineering labels Jun 24, 2021
@MelvinBot
Copy link

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

@MelvinBot MelvinBot added the Daily KSv2 label Jun 24, 2021
@jasperhuangg jasperhuangg removed their assignment Jun 24, 2021
@arielgreen
Copy link
Contributor

@rushatgabhane please apply here https://www.upwork.com/jobs/~01772f6a6c748c2faf

@jasperhuangg, this will remained assigned to you as well throughout the full process, as you'll be doing the PR review.

@aliabbasmalik8
Copy link
Contributor

SUGGESTION:

We can also show an error message on typing an invalid amount.

Thanks

@arielgreen
Copy link
Contributor

Paid + bonus for proposing and solving the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants