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-13] [$1000] On task description editing page field is showing mandatory when editing an existing task where by actually field should be optional #19022

Closed
6 tasks done
kavimuru opened this issue May 16, 2023 · 54 comments
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

Comments

@kavimuru
Copy link

kavimuru commented May 16, 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!


Action Performed:

  1. Launch the app -> Login in account
  2. Click on FAB button -> Click on Assign task option
  3. Enter title & description -> add any assignee -> Click on confirm task -> will navigate to task detail page
  4. On task detail page click on Description -> clear title field and press save -> Notice error message is This field is required instead of please enter a title

Expected Result:

On task description editing page field should be optional user can remove description & can save

Actual Result:

On task description editing page field is mandatory & user can't remove values

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.14.9
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

1

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

View all open jobs on GitHub

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

melvin-bot bot commented May 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 16, 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

by
@Dhairya Senjaliya

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

  • On task description editing page field is showing mandatory where by actually field is optional

What is the root cause of that problem?

The reason is we are validating on validate() Form to check if field is empty then throws the error message

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

We need to remove _.isEmpty(values.description validation from validate() function
And also on Task-actions we have one more condition where by if we have blank values on form then we are replacing it with old description name which we need to remove

// Change 1
// TaskDescriptionPage.js
-  const validate = useCallback(
-    (values) => {
-      const errors = {};
-      if (_.isEmpty(values.description)) {
-        errors.description = props.translate('common.error.fieldRequired');
-      }
-      return errors;
-    },
-    [props],
-  );
+.  const validate = useCallback(() => ({}), []);
          <TextInput
            inputID="description"
            name="description"
-           label={props.translate('newTaskPage.description')}
+           label={props.translate('newTaskPage.descriptionOptional')}
            defaultValue={(props.task.report && props.task.report.description) || ''}
            ref={(el) => (inputRef.current = el)}
          />
// Change 2
```diff
// libs/actions/Task.js
On editTaskAndNavigate()
 const optimisticData = [
    {
      onyxMethod: Onyx.METHOD.MERGE,
      key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.reportID}`,
      value: {[editTaskReportAction.reportActionID]: editTaskReportAction},
    },
    {
      onyxMethod: Onyx.METHOD.MERGE,
      key: `${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`,
      value: {
        reportName,
-		description: description || report.description,
+       description,
      	assignee: assignee || report.assignee,
      },
    },
 ];
// Optional change
  API.write(
    'EditTask',
    {
      taskReportID: report.reportID,
      title: reportName,
-      description: description || report.description,
+      description: description,
      assignee: assignee || report.assignee,
      editedTaskReportActionID: editTaskReportAction.reportActionID,
      assigneeChatReportActionID: optimisticAssigneeAddComment ? optimisticAssigneeAddComment.reportAction.reportActionID : 0,
    },
    {optimisticData, successData, failureData},
  );

What alternative solutions did you explore? (Optional)

  • N/A

@zanyrenney

This comment was marked as outdated.

@zanyrenney
Copy link
Contributor

@zanyrenney
Copy link
Contributor

checking here in slack too about version numbers : https://expensify.slack.com/archives/C01SKUP7QR0/p1684334987930659

@zanyrenney zanyrenney changed the title On task description editing page field is showing mandatory where by actually field is optional On task description editing page field is showing mandatory when editing an existing task where by actually field should be optional May 17, 2023
@zanyrenney
Copy link
Contributor

Okay, did some more testing and I understand the bug better now. It's that when you edit an existing task description, it is showing the error, not that the description field always throws an error.

@zanyrenney
Copy link
Contributor

Repro:
2023-05-17_15-59-50

@zanyrenney zanyrenney added the External Added to denote the issue can be worked on by a contributor label May 17, 2023
@melvin-bot melvin-bot bot changed the title On task description editing page field is showing mandatory when editing an existing task where by actually field should be optional [$1000] On task description editing page field is showing mandatory when editing an existing task where by actually field should be optional May 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0136c1b2820ecd2721

@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

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

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

melvin-bot bot commented May 17, 2023

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

@ahmdshrif
Copy link
Contributor

ahmdshrif commented May 17, 2023

Proposal

Problem:

The current issue in the app is that on the task description editing page, the field is mandatory and users are unable to remove the values. This contradicts the expected behavior, where the field should be optional, allowing users to remove the description and save the task without any text in the field.

###Root Cause:
The root cause of this problem is the validation check that enforces the title field to be filled in. When the user clears the title field and attempts to save the task, instead of accepting an empty field, the validation triggers an error message stating, "This field is required" instead of "Please enter a title."

Solution:

To address this issue, we propose removing the validation that enforces the title field to be non-empty on the task description editing page. By making the field optional, users will be able to remove the description and save the task without encountering any validation errors.

to implement that we should remove these lines

if (_.isEmpty(values.description)) {
errors.description = props.translate('common.error.fieldRequired');
}

or remove the validation function.

@fedirjh
Copy link
Contributor

fedirjh commented May 18, 2023

And also on Task-actions we have one more condition where by if we have blank values on form then we are replacing it with old description name which we need to remove

@dhairyasenjaliya can you elaborate more on why this is needed ? Also please note that we don’t allow diff code in the proposal

@dhairyasenjaliya
Copy link
Contributor

@fedirjh As mentioned description field is an optional field (users can leave it blank and also can remove it if they added it in the first place), but here while calling API editTaskAndNavigate where we have a condition whereby if we try to edit description and if that description is blank then we are passing old report as description which will never allow setting description field to be empty (which user should be able to do)

  • quick demo why we need to remove
Screen.Recording.2023-05-19.at.10.03.11.AM.mov

@fedirjh
Copy link
Contributor

fedirjh commented May 19, 2023

@dhairyasenjaliya's proposal looks good to me. I think we should proceed with it.

cc @joelbettner

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot added the Overdue label May 22, 2023
@zanyrenney
Copy link
Contributor

Thank you @fedirjh ! Bump to @joelbettner please can you give us a 👍🏼 if you agree so we can move forward here please?

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

still waiting for @joelbettner to create PR

@alexpensify
Copy link
Contributor

Alright, we are waiting for the automation to kick in here.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 6, 2023
@melvin-bot melvin-bot bot changed the title [$1000] On task description editing page field is showing mandatory when editing an existing task where by actually field should be optional [HOLD for payment 2023-06-13] [$1000] On task description editing page field is showing mandatory when editing an existing task where by actually field should be optional Jun 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.24-5 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-13. 🎊

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
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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 Jun 6, 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:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] 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:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@zanyrenney
Copy link
Contributor

Invited Dhairya
Fedi Rajhi - please accept the job offers!

@zanyrenney zanyrenney added Daily KSv2 and removed Weekly KSv2 labels Jun 13, 2023
@zanyrenney
Copy link
Contributor

payouts due

@dhairyasenjaliya
Copy link
Contributor

@zanyrenney also urgency bonus applicable on this

@zanyrenney
Copy link
Contributor

yep i will add that as the bonus amount :)

@fedirjh fedirjh mentioned this issue Jun 13, 2023
55 tasks
@fedirjh
Copy link
Contributor

fedirjh commented Jun 13, 2023

  • Link to the PR: Tasks Detailed View #17940
  • Link to comment: Tasks Detailed View #17940 (comment)
  • Link to discussion: I don't think an additional discussion is needed here. Commenting on the offending PR is enough for this issue. This bug should have been caught during PR review.
  • Determine if we should create a regression test for this bug. ✅

Regression Test Proposal

  1. Open the app
  2. Click on FAB button -> Click on Assign task option
  3. Enter title & description -> Select assignee -> Click on confirm to create new task
  4. Navigate to task detail page
  5. Click on Description -> Clear description field and press save
  6. Verify that you can save empty description as it's an optional field
  • Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Jun 13, 2023
@zanyrenney
Copy link
Contributor

Agree @fedirjh that sounds like a sensible regression test to add 👍🏼

@melvin-bot melvin-bot bot added the Overdue label Jun 16, 2023
@joelbettner
Copy link
Contributor

On hold. Not overdue.

@melvin-bot melvin-bot bot removed the Overdue label Jun 18, 2023
@dhairyasenjaliya
Copy link
Contributor

bump @zanyrenney

@zanyrenney
Copy link
Contributor

@dhairyasenjaliya - I have paid you in one payment for contribution + reporting bonus + timeline bonus.

@zanyrenney
Copy link
Contributor

@fedirjh paid you and the bonus 🎉

@zanyrenney
Copy link
Contributor

All good here - I have bumped the regression test to be completed. But I am closing this out now as we are all sorted and regression test has its own issue!

@dhairyasenjaliya
Copy link
Contributor

hey @zanyrenney can you please close the Upwork contract as well

@dhairyasenjaliya
Copy link
Contributor

Bump on closing @zanyrenney

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
Projects
None yet
Development

No branches or pull requests

8 participants