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

[$250] Web - Task - Contact number is not set as an assignee followed by @expensify.sms via [] method #40518

Closed
1 of 6 tasks
kbecciv opened this issue Apr 18, 2024 · 22 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Not a priority Reviewing Has a PR in review

Comments

@kbecciv
Copy link

kbecciv commented Apr 18, 2024

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


Version Number: 1.4.63-0
Reproducible in staging?: y
Reproducible in production?: y
Issue found when executing PR: #39475
Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Open any chat
  3. Type [] @<contact number followed by @expensify.sms> <task_name> and send to chat

Expected Result:

Task gets created with the contact number set as the assignee

Actual Result:

No user is filled out as the assignee

Workaround:

n/a

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6453351_1713428740830.bandicam_2024-04-18_11-16-51-031.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0107ae9ef02190251b
  • Upwork Job ID: 1783250182918488064
  • Last Price Increase: 2024-04-24
  • Automatic offers:
    • s77rt | Reviewer | 0
    • nkdengineer | Contributor | 0
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 18, 2024
Copy link

melvin-bot bot commented Apr 18, 2024

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@kbecciv
Copy link
Author

kbecciv commented Apr 18, 2024

We think that this bug might be related to #vip-vsb

@kbecciv
Copy link
Author

kbecciv commented Apr 18, 2024

@johncschuster FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.

@nkdengineer
Copy link
Contributor

Proposal

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

No user is filled out as the assignee

What is the root cause of that problem?

For the mentionWithDomain that we don't have the login data of it in personalDetails, assignee value is empty and then the task is created without assignee.

assignee = Object.values(allPersonalDetails).find((value) => value?.login === mentionWithDomain) ?? {};

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

If assignee value here is empty object, we should create a optimistic personal detail for this and also create optimistic chat report as we do in setAssigneeValue function here.

assignee = Object.values(allPersonalDetails).find((value) => value?.login === mentionWithDomain) ?? {};

  1. Create a util like buildOptimisticTaskDataForNewAssingee that will merge the optimistic data to Onyx and return an optimistic personal detail and an optimistic assigneeChatReport
function buildOptimisticTaskDataForNewAssingee(assigneeLogin: string) {
    const assigneeAccountID = UserUtils.generateAccountID(assigneeLogin);
    let report: OnyxEntry<Report> | undefined = buildOptimisticChatReport([assigneeAccountID]);
    report.isOptimisticReport = true;

    // When assigning a task to a new user, by default we share the task in their DM
    // However, the DM doesn't exist yet - and will be created optimistically once the task is created
    // We don't want to show the new DM yet, because if you select an assignee and then change the assignee, the previous DM will still be shown
    // So here, we create it optimistically to share it with the assignee, but we have to hide it until the task is created
    if (report) {
        report.isHidden = true;
    }
    Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, report);

    const optimisticPersonalDetailsListAction = {
        accountID: assigneeAccountID,
        avatar: allPersonalDetails?.[assigneeAccountID]?.avatar ?? UserUtils.getDefaultAvatarURL(assigneeAccountID),
        displayName: assigneeLogin,
        login: assigneeLogin,
    };
    Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, {[assigneeAccountID]: optimisticPersonalDetailsListAction});
    return {assignee: optimisticPersonalDetailsListAction, assigneeReport: report}
}
  1. Call the function above here if assignee is empty object to get the optimistic data.
let assignee: OnyxTypes.PersonalDetails | EmptyObject = {};
let assigneeChatReport = undefined;
if (mentionWithDomain) {
    assignee = Object.values(allPersonalDetails).find((value) => value?.login === mentionWithDomain) ?? {};
    if (!Object.keys(assignee).length) {
        const optimisticDataForNewAssignee = ReportUtils.buildOptimisticTaskDataForNewAssingee(mentionWithDomain);
        assignee = optimisticDataForNewAssignee.assignee;
        assigneeChatReport = optimisticDataForNewAssignee.assigneeReport;
    }
}
Task.createTaskAndNavigate(report.reportID, title, '', assignee?.login ?? '', assignee.accountID, assigneeChatReport, report.policyID);

assignee = Object.values(allPersonalDetails).find((value) => value?.login === mentionWithDomain) ?? {};

What alternative solutions did you explore? (Optional)

NA

Copy link

melvin-bot bot commented Apr 22, 2024

@johncschuster Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Apr 24, 2024

@johncschuster Huh... This is 4 days overdue. Who can take care of this?

@johncschuster
Copy link
Contributor

Agreed that this fits into #vip-vsb.

@melvin-bot melvin-bot bot removed the Overdue label Apr 24, 2024
@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Apr 24, 2024
@melvin-bot melvin-bot bot changed the title Web - Task - Contact number is not set as an assignee followed by @expensify.sms via [] method [$250] Web - Task - Contact number is not set as an assignee followed by @expensify.sms via [] method Apr 24, 2024
Copy link

melvin-bot bot commented Apr 24, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0107ae9ef02190251b

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 24, 2024
Copy link

melvin-bot bot commented Apr 24, 2024

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

@s77rt
Copy link
Contributor

s77rt commented Apr 25, 2024

@nkdengineer Thanks for the proposal. Your RCA is correct. The solution looks good to me.

🎀 👀 🎀 C+ reviewed
Link to proposal

Copy link

melvin-bot bot commented Apr 25, 2024

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

@abzokhattab
Copy link
Contributor

abzokhattab commented Apr 25, 2024

I reported this bug here.. wondering if I am eligible for reporting bounty.

cc @nkuoch @johncschuster

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 26, 2024
Copy link

melvin-bot bot commented Apr 26, 2024

📣 @s77rt 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Apr 26, 2024

📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 Weekly KSv2 and removed Daily KSv2 labels Apr 28, 2024
@nkdengineer
Copy link
Contributor

@s77rt The PR is here.

@melvin-bot melvin-bot bot removed the Weekly KSv2 label May 21, 2024
Copy link

melvin-bot bot commented May 21, 2024

This issue has not been updated in over 15 days. @nkuoch, @johncschuster, @s77rt, @nkdengineer eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added the Monthly KSv2 label May 21, 2024
@s77rt
Copy link
Contributor

s77rt commented May 21, 2024

PR was deployed to production 2 weeks ago

@nkdengineer
Copy link
Contributor

@johncschuster This has been on production for a while, could you help with payments here?

Thanks

@johncschuster
Copy link
Contributor

Payment has been issued. Thanks for your patience on this!

@johncschuster
Copy link
Contributor

@s77rt do you feel we need a regression test for this? If not, I think we can close this up!

@s77rt
Copy link
Contributor

s77rt commented Jul 3, 2024

@johncschuster I don't think this needs a regression test. It's unlikely for this to resurface again.

Copy link

melvin-bot bot commented Aug 30, 2024

@nkuoch, @johncschuster, @s77rt, @nkdengineer, this Monthly task hasn't been acted upon in 6 weeks; closing.

If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Not a priority Reviewing Has a PR in review
Projects
No open projects
Status: No status
Development

No branches or pull requests

6 participants