-
Notifications
You must be signed in to change notification settings - Fork 3k
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 2023-05-03] [$1000] White spaces accepted as Description #17485
Comments
Triggered auto assignment to @johncschuster ( |
Bug0 Triage Checklist (Main S/O)
|
Are you accepting proposals for this? |
ProposalPlease re-state the problem that we are trying to solve in this issue.White spaces accepted as description text for the IOU action. What is the root cause of that problem?The root cause of this issue is that we're not trimming the comment value here. What changes do you think we should make in order to solve the problem?We can trim the value here. We can also What alternative solutions did you explore? (Optional)None |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
ProposalPlease re-state the problem that we are trying to solve in this issue.When a user enters only spaces as the description when requesting or sending money, the input is not validated. What is the root cause of that problem?Currently, validation is not being performed on the description field. Checking the relevant line of code in
What changes do you think we should make in order to solve the problem?A validate handler needs to be implemented. However, this will not follow the structure of typical validate handlers similar to other classes, because form values which are strings are trimmed by default, so it's impossible to test that it is a string of only whitespaces using the established method. The
What alternative solutions did you explore? (Optional)
|
Bug0 Checklist complete. Triaging to |
Triggered auto assignment to @alex-mechler ( |
I'm not sure this is an issue based on our forms guidelines. Started a discussion in slack https://expensify.slack.com/archives/C049HHMV9SM/p1681941815754119?thread_ts=1681557252.708949&cid=C049HHMV9SM |
Job added to Upwork: https://www.upwork.com/jobs/~0114b38bf7df129f99 |
Current assignee @johncschuster is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
Current assignee @alex-mechler is eligible for the External assigner, not assigning anyone new. |
ProposalPlease re-state the problem that we are trying to solve in this issue.User can write White spaces as Description. What is the root cause of that problem?After I debug the request But we have conflict issue in UX, we use description as optional value but because the form only have this input, we need to prevent user to submit "add description" form if he types empty string or leave it empty and the only option should be available to him is go back. What changes do you think we should make in order to solve the problem?We need to add validation for description value validate(values) {
const errors = {};
if (!_.isString(values.moneyRequestComment) || _.isEmpty(values.moneyRequestComment.trim())) {
errors.moneyRequestComment = 'we will add custom error here';
}
return errors;
}
<Form
....
validate={this.validate} /> What alternative solutions did you explore? (Optional)keep the value optional and without validation and use confirmation modal to confirm the user after click save is he want to leave without comment? |
ProposalPlease re-state the problem that we are trying to solve in this issue.White spaces accepted as description What is the root cause of that problem?Currently, when user submits description form, we store whatever user input into the Onyx in this line What changes do you think we should make in order to solve the problem?We can trim the spaces from user input before store in Onyx, in this line IOU.setMoneyRequestDescription(value.moneyRequestComment.trim()); |
@Santhosh-Sellavel Similar issue was External before this issue here |
Yeah, I see we go by the earlier reported issue first. I see your proposal got accepted there. But it is pretty much the dupe of @allroundexperts's proposal, So I think this should be awarded to @allroundexperts anyways wherever we handle this one. Since it got closed we already have a proposal from @allroundexperts here we are good to proceed here, thanks! @alex-mechler we are good to go with @allroundexperts here, thanks! C+ Reviewed |
@johncschuster accepted, Thanks! |
@alex-mechler If you differ in any of the above let me know, thanks! |
@gadhiyamanan I've just paid out the reporting bonus! Thanks for the report! @Santhosh-Sellavel, can you apply when you get a moment? I don't see your application in Upwork. |
Oh geez, I was holding it wrong. Thanks for pointing that out, @Santhosh-Sellavel! I've sent you the offer! |
Regression Test StepsSteps from the PR Look good to me.
👍 or 👎 |
Maybe we should have the description have both leading and trailing spaces, and verify they are trimmed? Other than that 👍 |
@johncschuster Bump on completing your step in the BZ checklist / making sure this gets paid out. |
Done! |
@johncschuster bump this is not paid yet |
I’m going to be flying to EC3 today and part of tomorrow. Reassigning so the payment can get taken care of. |
Triggered auto assignment to @isabelastisser ( |
Bug0 Triage Checklist (Main S/O)
|
The payments were made in Upwork now; we are all set! |
Just an FYI, the QA steps were not added, as this behavior was considered an edge case. Please feel free to reopen the linked issue above if you disagree! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected results:
should not show whitespaces
Actual results:
White space accept as description
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.0
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
Screen.Recording.2023-04-15.at.4.40.55.PM.mov
Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681557252708949
View all open jobs on GitHub
Recording.249.mp4
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: