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-19] [$1000] Assign Task - An incorrect error message is displayed when clicking confirm task #18669

Closed
6 tasks done
kbecciv opened this issue May 9, 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

@kbecciv
Copy link

kbecciv commented May 9, 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. Go to URL https://staging.new.expensify.com/
  2. Login with any Expensifail account
  3. Go to FAB -> Assign task
  4. Enter a title and description and navigate to the next page
  5. Click Confirm task without entering Assignee

Expected Result:

The error asks for a share destination but not a title

Actual Result:

An incorrect message is displayed.
The title was entered, and the error asks for it

Workaround:

Unknown

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

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Bug6048425_Recording__4489.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015e12624031ff7035
  • Upwork Job ID: 1656738721911836672
  • Last Price Increase: 2023-05-18
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels May 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

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

@melvin-bot
Copy link

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

@allroundexperts
Copy link
Contributor

allroundexperts commented May 9, 2023

Proposal

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

Incorrect error message is shown when trying to submit a task

What is the root cause of that problem?

The root cause is this condition. Here, we're showing the same error if either of title or shareDestination is false.

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

We need to replace this with:

 if (props.task.title) {
            setSubmitError(true);
            setErrorMessage('');
            return;
        }

        if (props.task.shareDestination) {
            setSubmitError(true);
            setErrorMessage('');
            return;
        }

I've left the error message for each case to be empty because they don't exist yet and we'll need Spanish translations for it as well.

I think we don't need to store the error message in the state. Since we're already doing a setSubmitError state update, even simple variable containing the error would show up correctly.

What alternative solutions did you explore? (Optional)

None

@dhairyasenjaliya
Copy link
Contributor

Proposal

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

  • Assign Task - An incorrect error message is displayed when clicking confirm task

What is the root cause of that problem?

  • The root cause is we are throwing an general error when title and description field is empty and also we are using state to display message so when we find any new error on input we just need to update state errors message as well which currently we are not doing

  • Since description filed is optional still we are validating to show error which is not required

  • Also we are not checking if there is assignee on task or not show for that reason we are able to see the error message

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

  • As description filed is optional so we need to remove validation on NewTaskPage.js
    function onSubmit() {
-       if (!props.task.title || !props.task.shareDestination) {
+       if (!props.task.title)
+.          setErrorMessage('newTaskPage.pleaseEnterTaskName')
             setSubmitError(true);
            return;
        } 
  • There is one more validation remaining to see if there is assignee added for that task or not currently we are not checking so we just need to add one more validation on onSubmit() of NewTaskPage.js
+        if(!props.task.assignee){ // or we can add this condition as well [ lodashGet(props.personalDetails, props.task.assignee) ]
+           setSubmitError(true);
+          return setErrorMessage(props.translate('newTaskPage.pleaseEnterTaskAssignee'));
+        } 

Result

What alternative solutions did you explore? (Optional)

  • None

@kevinksullivan
Copy link
Contributor

discussed in slack and going to move forward with solving this here. CC @thienlnam

@kevinksullivan kevinksullivan added the External Added to denote the issue can be worked on by a contributor label May 11, 2023
@melvin-bot melvin-bot bot changed the title Assign Task - An incorrect error message is displayed when clicking confirm task [$1000] Assign Task - An incorrect error message is displayed when clicking confirm task May 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

Job added to Upwork: https://www.upwork.com/jobs/~015e12624031ff7035

@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 11, 2023

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

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

melvin-bot bot commented May 11, 2023

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

@dummy-1111
Copy link
Contributor

Proposal

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

Incorrect error message when trying to confirm task without assignee.

What is the root cause of that problem?

Error message is set below

const [errorMessage, setErrorMessage] = React.useState(props.translate('newTaskPage.confirmError'));

and set submitError as true here

if (!props.task.title || !props.task.shareDestination) {
setSubmitError(true);
return;
}

This is the main reason.

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

Now we are using submitError and errorMessage to show error. I don't think we need both variables.
We can use errorMessage to show whether there exists error or not. If no errors, errorMessage would be empty, or errorMessage will be filled with proper message.

First, replace these 2 lines

const [submitError, setSubmitError] = React.useState(false);
const [errorMessage, setErrorMessage] = React.useState(props.translate('newTaskPage.confirmError'));

with this one:

    const [errorMessage, setErrorMessage] = React.useState('');

Replace this line

setSubmitError(false);

with

        setErrorMessage('');

Remove this line

setSubmitError(true);

Replace these lines

if (!props.task.title || !props.task.shareDestination) {
setSubmitError(true);
return;
}

with

        if (!props.task.title) {
            setErrorMessage(props.translate('newTaskPage.titleError'));
            return;
        }

        if (!props.task.shareDestination) {
            setErrorMessage(props.translate('newTaskPage.shareDestinationError'));
            return;
        }

Change this line

isAlertVisible={submitError}

       isAlertVisible={!!errorMessage}

Lastly, add the corresponding translation data.
This would effectively remove the redundant state and show proper error messages.

What alternative solutions did you explore? (Optional)

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

@aimane-chnaif have you had time to review the proposals?

@melvin-bot melvin-bot bot removed the Overdue label May 16, 2023
@kevinksullivan
Copy link
Contributor

I'm going to reassign this since I'll be OOO for several days.

@kevinksullivan kevinksullivan removed their assignment May 18, 2023
@kevinksullivan kevinksullivan added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels May 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

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

@Expensify Expensify deleted a comment from melvin-bot bot May 18, 2023
@MitchExpensify
Copy link
Contributor

@aimane-chnaif have you had time to review the proposals?

Friendly bump @aimane-chnaif

@melvin-bot
Copy link

melvin-bot bot commented May 18, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@madmax330 madmax330 added the Waiting for copy User facing verbiage needs polishing label Jun 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

Triggered auto assignment to @NickTooker (Waiting for copy), see https://stackoverflow.com/c/expensify/questions/7025/ for more details.

@NickTooker
Copy link

Copy looks good - straight forward. I would put periods on the end of the sentences. Thanks!

@aimane-chnaif
Copy link
Contributor

Thanks @NickTooker

@MitchExpensify
Copy link
Contributor

Unassigning myself to pass the bug-zero baton back to @kevinksullivan since he's returned from OOO 👍

@kevinksullivan kevinksullivan removed the Waiting for copy User facing verbiage needs polishing label Jun 6, 2023
@NickTooker
Copy link

Un-assigning myself - feel free to reassign me if you need more copy input.

@NickTooker NickTooker removed their assignment Jun 6, 2023
@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 12, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Assign Task - An incorrect error message is displayed when clicking confirm task [HOLD for payment 2023-06-19] [$1000] Assign Task - An incorrect error message is displayed when clicking confirm task Jun 12, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 12, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.26-4 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-19. 🎊

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 12, 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:

  • [@allroundexperts / @aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts / @aimane-chnaif] 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:
  • [@allroundexperts / @aimane-chnaif] 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:
  • [@allroundexperts / @aimane-chnaif] Determine if we should create a regression test for this bug.
  • [@allroundexperts / @aimane-chnaif] 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.
  • [@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@kevinksullivan
Copy link
Contributor

Hey @aimane-chnaif and @allroundexperts , please finish out the steps above so I can pay this on time. Thanks!

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

Hi @aimane-chnaif @allroundexperts bumping the above. Please finish this out and then I'll make the payments. Thanks!

@aimane-chnaif
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Create Task FrontEnd Changes #17992
  • 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: https://github.com/Expensify/App/pull/17992/files#r1234737484
  • 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: N/A
  • Determine if we should create a regression test for this bug.
  • 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.

No PRs caused regression but the error messages were not thoroughly handled while implementing new create task feature.

Regression Test Proposal:

Case 1:

  1. Login any account
  2. Go to FAB > Assign task > Enter title > click Next
  3. Just click "Confirm task" button without selecting anything
  4. Verify that "Please select with whom you want to share." message shows

Case 2:

  1. Login any account
  2. Navigate to new.expensify.com/new/task directly
  3. Verify that nothing is selected, even title is empty
  4. Just click "Confirm task" button without selecting anything
  5. Verify that "Please enter a title and select a share destination." message shows

@aimane-chnaif
Copy link
Contributor

Timeline analysis:

  • Contributor assigned: May 25
  • Hold on Waiting for copy until May 30 (issue resumed)
  • Another hold on Waiting for copy confirmation: Jun 1
  • Issue resumed again on Jun 5
  • C+ approved PR on Jun 6
  • PR merged without changes on Jun 7

Total active days to clock: 3 days (May 30 - Jun 1, Jun 5 - Jun 6)

@kevinksullivan
Copy link
Contributor

Thanks @aimane-chnaif . Payments are made but I am waiting for upwork to let me end the contract 🙃 .

image

@kevinksullivan
Copy link
Contributor

Will close this out and set a reminder to check the job for ending contract. Thanks 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
Projects
None yet
Development

No branches or pull requests

9 participants