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-01] [$1000] Assign Task - An error when try to add phone number as Assignee #18649

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


Issue found when executing PR #17992

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Login with any Expensifail account
  3. Go to FAB -> Assign Task -> Enter a title and description and navigate to next page
  4. Click on the "Assignee" and enter the correct phone number

Expected Result:

Phone number added as assignee

Actual Result:

An error appears

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

Bug6048291_Recording__4487.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/~01083e1135163c2e99
  • Upwork Job ID: 1658651701339316224
  • Last Price Increase: 2023-05-17
@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 @maddylewis (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

@melvin-bot
Copy link

melvin-bot bot commented May 12, 2023

@maddylewis Whoops! This issue is 2 days overdue. Let's get this updated quick!

@maddylewis
Copy link
Contributor

back from OOO / will action today

@melvin-bot melvin-bot bot removed the Overdue label May 15, 2023
@maddylewis

This comment was marked as resolved.

@maddylewis maddylewis added the Needs Reproduction Reproducible steps needed label May 15, 2023
@maddylewis

This comment was marked as resolved.

@maddylewis maddylewis added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels May 17, 2023
@melvin-bot melvin-bot bot changed the title Assign Task - An error when try to add phone number as Assignee [$1000] Assign Task - An error when try to add phone number as Assignee May 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01083e1135163c2e99

@melvin-bot
Copy link

melvin-bot bot commented May 17, 2023

Current assignee @maddylewis 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 - @0xmiroslav (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 @luacmartins (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@maddylewis
Copy link
Contributor

i can repro this -
image

@akinwale
Copy link
Contributor

Proposal

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

An error occurs when trying to add phone number as Assignee.

What is the root cause of that problem?

The code for checking assignees is trying to query the personal details of the current session for the details of the assignee account. This error will also occur with any email address that is not associated with the current user session.

const assigneeDetails = lodashGet(props.personalDetails, props.task.assignee);

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

It looks like there is an issue with the logic for checking assigneeDetails.

const assigneeDetails = lodashGet(props.personalDetails, props.task.assignee);
if (!assigneeDetails) {
setSubmitError(true);
return setErrorMessage(props.translate('newTaskPage.assigneeError'));
}

If this is supposed to be a check to make sure that a user cannot assign tasks to themselves (or accounts associated with them), then changing the condition check to if (assigneeDetails) the error.

What alternative solutions did you explore? (Optional)

None.

@dukenv0307
Copy link
Contributor

dukenv0307 commented May 17, 2023

Proposal

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

An error when try to add phone number as Assignee

What is the root cause of that problem?

When selecting user that has phone number option.alternateText is set to task.assignee, but key in props.personalDetails object is option.login. option.alternateText and option.login is different if the user use phone number to create account.
image

if (!props.route.params && option.alternateText) {
// Clear out the state value, set the assignee and navigate back to the NewTaskPage
setSearchValue('');
TaskUtils.setAssigneeValue(option.alternateText, props.task.shareDestination);
return Navigation.goBack();
}
// Check to see if we're editing a task and if so, update the assignee
if (props.route.params.reportID && props.task.report.reportID === props.route.params.reportID) {
// There was an issue where sometimes a new assignee didn't have a DM thread
// This would cause the app to crash, so we need to make sure we have a DM thread
TaskUtils.setAssigneeValue(option.alternateText, props.task.shareDestination);
// Pass through the selected assignee
TaskUtils.editTaskAndNavigate(props.task.report, props.session.email, '', '', option.alternateText);

So that when getting personalDetail of assignee in here, assigneeDetails is undefined and the error appears.
const assigneeDetails = lodashGet(props.personalDetails, props.task.assignee);

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

We should set option.login to assignee value instead of option.alternateText when selecting assignee in here

if (!props.route.params && option.alternateText) {
// Clear out the state value, set the assignee and navigate back to the NewTaskPage
setSearchValue('');
TaskUtils.setAssigneeValue(option.alternateText, props.task.shareDestination);
return Navigation.goBack();
}
// Check to see if we're editing a task and if so, update the assignee
if (props.route.params.reportID && props.task.report.reportID === props.route.params.reportID) {
// There was an issue where sometimes a new assignee didn't have a DM thread
// This would cause the app to crash, so we need to make sure we have a DM thread
TaskUtils.setAssigneeValue(option.alternateText, props.task.shareDestination);
// Pass through the selected assignee
TaskUtils.editTaskAndNavigate(props.task.report, props.session.email, '', '', option.alternateText);

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label May 19, 2023
@luacmartins
Copy link
Contributor

@dukenv0307 proposal's look good to me.

@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

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

@dukenv0307
Copy link
Contributor

@0xmiroslav @luacmartins the PR is ready to review.

@melvin-bot
Copy link

melvin-bot bot commented May 22, 2023

🎯 ⚡️ Woah @0xmiroslav / @dukenv0307, 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 @dukenv0307 got assigned: 2023-05-19 21:02:27 Z
  • when the PR got merged: 2023-05-22 13:10:59 UTC

On to the next one 🚀

@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 25, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Assign Task - An error when try to add phone number as Assignee [HOLD for payment 2023-06-01] [$1000] Assign Task - An error when try to add phone number as Assignee May 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented May 25, 2023

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

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 May 25, 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:

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

@maddylewis maddylewis added Daily KSv2 and removed Weekly KSv2 labels May 31, 2023
@melvin-bot melvin-bot bot added the Overdue label May 31, 2023
@maddylewis
Copy link
Contributor

reviewing / processing payment on Thurs

@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Daily KSv2 labels May 31, 2023
@maddylewis
Copy link
Contributor

maddylewis commented Jun 1, 2023

Payments

  • no reporting bonus
  • Paid @0xmiroslav (C+) - $1000 + bonus = $1500
  • Paid @dukenv0307 - $1000 + bonus = $1500

@maddylewis
Copy link
Contributor

offer sent to @0xmiroslav 👍

@dukenv0307 - can you link me your Upwork profile or confirm how your name shows in Upwork? thanks!

@maddylewis
Copy link
Contributor

@0xmiroslav - will you run through your portion of this checklist? thanks! #18649 (comment)

@dukenv0307
Copy link
Contributor

@maddylewis My link Upwork profile: https://www.upwork.com/freelancers/~01f5cbe690701118a2.
Thank you!

@0xmiros
Copy link
Contributor

0xmiros commented Jun 1, 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:

  • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR: Create Task FrontEnd Changes #17992
  • [@0xmiroslav] 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#r1213473105
  • [@0xmiroslav] 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. Comment on offending PR is enough

This is not a regression (which means worked before but recently broken) but overlooked while implementing new feature of creating task. I don't think we need regression test step here.

@maddylewis
Copy link
Contributor

offer sent to @dukenv0307 !

@maddylewis
Copy link
Contributor

everyone is paid - closing!

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

6 participants