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 2023-06-02] [$1000] white space accepted as description in Assign task #18796

Closed
6 tasks done
kavimuru opened this issue May 11, 2023 · 39 comments
Closed
6 tasks done
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Task

Comments

@kavimuru
Copy link

kavimuru commented May 11, 2023

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


  1. Action Performed:

  2. Click on FAB button -> Click on Assign task option
  3. Enter description as white space
  4. click on Next button

Expected Result:

description should be trimmed

Actual Result:

description not trimmed

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?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.13.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

Simulator.Screen.Recording.-.iPhone.13.-.2023-05-10.at.20.13.42.mp4
Recording.557.mp4

Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683729900378959

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011652c334684162d9
  • Upwork Job ID: 1659614646252167168
  • Last Price Increase: 2023-05-19
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@kavimuru
Copy link
Author

Proposal

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

leading and trailing space accepted as description and title in Assign task

What is the root cause of that problem?

we're not trimming the title and description

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

We can trim() the title and description at the below pages

TaskUtils.setDetailsValue(values.taskTitle, values.taskDescription);

TaskUtils.setDescriptionValue(values.taskDescription);

TaskUtils.setTitleValue(values.taskTitle);

What alternative solutions did you explore? (Optional)

None

@allroundexperts
Copy link
Contributor

I think it was decided that we shouldn't fiddle with the user input in this issue cc @pecanoro

@gadhiyamanan
Copy link
Contributor

we have similar issues which we have solved
#17485
#17770
#14287
#18006

@pecanoro
Copy link
Contributor

pecanoro commented May 12, 2023

I opened a discussion internally to see what we should do in these cases.

@allroundexperts
Copy link
Contributor

Thanks @pecanoro!

@strepanier03
Copy link
Contributor

I'm following along with the discussion. Also, I don't have the task option in my FAB, so I'll look into that for proper testing on my end.

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@strepanier03
Copy link
Contributor

Bumped the discussion in Slack.

@melvin-bot melvin-bot bot removed the Overdue label May 15, 2023
@strepanier03
Copy link
Contributor

We haven't reached a decision yet but I bumped the thread so we can move forward.

@strepanier03
Copy link
Contributor

The discussion was opened up to a wider audience today. Post in #expensify-open-source here.

If no pushback by tomorrow I'll move this forward with trimming as the goal.

@strepanier03
Copy link
Contributor

Conclusion of discussion:

We have decided to take an always trim stance moving forward so we are free to move this to external to work on trimming the white space.

Note: We don't want to trim white space between individual words of course.

@strepanier03 strepanier03 added the External Added to denote the issue can be worked on by a contributor label May 19, 2023
@melvin-bot melvin-bot bot changed the title white space accepted as description in Assign task [$1000] white space accepted as description in Assign task May 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011652c334684162d9

@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

Current assignee @strepanier03 is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

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

@gadhiyamanan
Copy link
Contributor

gadhiyamanan commented May 19, 2023

Proposal

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

leading and trailing spaces space accepted as description and title in Assign task

What is the root cause of that problem?

we're not trimming the title and description

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

We can trim() the title and description at the below pages

TaskUtils.setDetailsValue(values.taskTitle, values.taskDescription);

TaskUtils.setDescriptionValue(values.taskDescription);

TaskUtils.setTitleValue(values.taskTitle);

TaskUtils.editTaskAndNavigate(props.task.report, props.session.email, values.title, '', '');

TaskUtils.editTaskAndNavigate(props.task.report, props.session.email, '', values.description, '');

What alternative solutions did you explore? (Optional)

None

@BhuvaneshPatil
Copy link
Contributor

Proposal

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

While Assigning a task, in the first section of modal that opens from right. Description value that is saved is saved with trialing and leading spaces.

What is the root cause of that problem?

The root cause of problem is we are not cleaning (trimming) the value before we set that value in state.

function onSubmit(values) {
TaskUtils.setDetailsValue(values.taskTitle, values.taskDescription);
Navigation.navigate(ROUTES.NEW_TASK);
}

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

The solution to this problem is trimming the value before actually saving it into state (.setDetailsValue) on - To implement this we can use trim() method from javascript.

function onSubmit(values) {
TaskUtils.setDetailsValue(values.taskTitle, values.taskDescription);

What alternative solutions did you explore? (Optional)

There are many places where we are taking input for description in Assign Task. We need to change them as well.
Good approaches are

  • To create a utility function for such task and use it everywhere.
  • Create a function in TaskUtils that will be called whenever we are saving the description.

@melvin-bot melvin-bot bot removed the Overdue label May 22, 2023
@gadhiyamanan
Copy link
Contributor

Add defaultValue={props.task.description} to description field

<TextInput
inputID="taskDescription"
label={props.translate('newTaskPage.descriptionOptional')}
/>

Add also add defaultProps and propTypes

    task: {
        description: '',
    },
    task: PropTypes.shape({
        /** Description of the Task */
        description: PropTypes.string,
    }),

OR

we can add defaultValue="" . we are using defaultValue="" in EmojiPickerMenu because we are trying to trim text in filterEmojis

<TextInput
label={this.props.translate('common.search')}
onChangeText={this.filterEmojis}
defaultValue=""
ref={(el) => (this.searchInput = el)}
autoFocus
selectTextOnFocus={this.state.selectTextOnFocus}
onSelectionChange={this.onSelectionChange}
onFocus={() => this.setState({isFocused: true, highlightedIndex: -1, isUsingKeyboardMovement: false})}
onBlur={() => this.setState({isFocused: false})}

filterEmojis(searchTerm) {
const normalizedSearchTerm = searchTerm.toLowerCase().trim().replaceAll(':', '');

cc: @sobitneupane

@iwiznia
Copy link
Contributor

iwiznia commented May 22, 2023

We can trim() the title and description at the below pages

@sobitneupane, @gadhiyamanan maybe it would be better to call trim inside all those methods instead of on the caller?

@gadhiyamanan
Copy link
Contributor

maybe it would be better to call trim inside all those methods instead of on the caller?

In that case, We can add trim() to below lines

const reportName = title || report.reportName;

description: description || report.description,

Onyx.merge(ONYXKEYS.TASK, {title, description});

Onyx.merge(ONYXKEYS.TASK, {title});

Onyx.merge(ONYXKEYS.TASK, {description});

@iwiznia
Copy link
Contributor

iwiznia commented May 22, 2023

Cool, sounds good.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

📣 @gadhiyamanan You have been assigned to this job by @iwiznia!
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 📖

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label May 22, 2023
@gadhiyamanan
Copy link
Contributor

@sobitneupane PR is ready for review

@melvin-bot
Copy link

melvin-bot bot commented May 24, 2023

🎯 ⚡️ Woah @sobitneupane / @gadhiyamanan, great job pushing this forwards! ⚡️

The pull request got merged within 2 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @gadhiyamanan got assigned: 2023-05-22 16:59:37 Z
  • when the PR got merged: 2023-05-24 16:43:38 UTC

On to the next one 🚀

@strepanier03
Copy link
Contributor

PR is merged and awaiting deploy. All good here for now.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 26, 2023
@melvin-bot melvin-bot bot changed the title [$1000] white space accepted as description in Assign task [HOLD for payment 2023-06-02] [$1000] white space accepted as description in Assign task May 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 26, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 26, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.18-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-06-02. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter - @gadhiyamanan - $250
  • Contributor that fixed the issue - @gadhiyamanan - $1000 + $500 (speed bonus) = $1500
  • Contributor+ that helped on the issue and/or PR - @sobitneupane - $1000 + $500 (speed bonus) = $1500

Speed bonus assessment: Contributor hired on May 22 / PR merged on May 24 = 2 days Eligible for bonus

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented May 26, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 1, 2023
@strepanier03
Copy link
Contributor

Prepping for hold removal tomorrow.


@gadhiyamanan - I have hired you for the job in Upwork. I will pay the reporting bonus for this job in the one I hired you for so we don't have to make a second job, if that's okay. The total with speed bonus will be $1750.

@sobitneupane - I've hired you as well. Feel free to complete the checklist and I'll update it and create the reg test GH if needed, then do the pay out.

Back tomorrow 👋

@sobitneupane
Copy link
Contributor

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

#17992

  • [@sobitneupane] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

#17992 (comment)

  • [@sobitneupane] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

https://expensify.slack.com/archives/C049HHMV9SM/p1685954728540999

  • [@sobitneupane] Determine if we should create a regression test for this bug.

I don't think separate regression test will be required. QA should make sure that white space are not accepted in any text input.

@melvin-bot melvin-bot bot removed the Overdue label Jun 5, 2023
@strepanier03
Copy link
Contributor

Awesome, thank you for that @sobitneupane.

I have paid everyone and finished off the checklist. Closing this out now.

Fantastic job everyone!

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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Task
Projects
None yet
Development

No branches or pull requests

8 participants