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-11-13] Assign task – Unable to assign subtask in task report when create task in 1:1 DM. #30804

Closed
6 tasks done
lanitochka17 opened this issue Nov 2, 2023 · 29 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 Engineering

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 2, 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!


Version Number: 1.3.95-0
Reproducible in staging?: Y
Reproducible in production?: N
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in with any Gmail account
  3. Open a 1:1 chat
  4. Navigate to the "Assign Task" section
  5. Enter the task title and assigned it
  6. Click "Confirm Task" to create the task
  7. In the task report - Click + and select "Assign Task" again to create a sub-task

Expected Result:

"Assign Task" option appears to create a sub-task

Actual Result:

"Assign Task" option is missing

Workaround:

Unknown

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

Recording.355.mp4

Production:

Recording.356.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 2, 2023
Copy link

melvin-bot bot commented Nov 2, 2023

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

Copy link

melvin-bot bot commented Nov 2, 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

@OSBotify
Copy link
Contributor

OSBotify commented Nov 2, 2023

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Nov 2, 2023

Triggered auto assignment to @chiragsalian (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@bernhardoj
Copy link
Contributor

Proposal

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

Unable to create a sub-task.

What is the root cause of that problem?

We recently have a PR #30019 that doesn't allow a task to be created when all of the participants are special Expensify accounts.

App/src/libs/ReportUtils.js

Lines 527 to 542 in d53a03e

/**
* Returns whether a given report can have tasks created in it.
* We only prevent the task option if it's a DM/group-DM and the other users are all special Expensify accounts
*
* @param {Object} report
* @returns {Boolean}
*/
function canCreateTaskInReport(report) {
const otherReportParticipants = _.without(lodashGet(report, 'participantAccountIDs', []), currentUserAccountID);
const areExpensifyAccountsOnlyOtherParticipants = _.every(otherReportParticipants, (accountID) => _.contains(CONST.EXPENSIFY_ACCOUNT_IDS, accountID));
if (areExpensifyAccountsOnlyOtherParticipants && isDM(report)) {
return false;
}
return true;
}

To achieve that, we check if all the participants (except ourselves) are special Expensify accounts using _.every. However, on a task report without an assignee, the participant is empty, and if it's empty, _.every will always return true.

// always returns true
_.every([], () => false)

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

Check if the other participants are not empty before doing the _.every logic

-const areExpensifyAccountsOnlyOtherParticipants = _.every(otherReportParticipants, (accountID) => _.contains(CONST.EXPENSIFY_ACCOUNT_IDS, accountID));
+const areExpensifyAccountsOnlyOtherParticipants = otherReportParticipants.length >= 1 && _.every(otherReportParticipants, (accountID) => _.contains(CONST.EXPENSIFY_ACCOUNT_IDS, accountID));

@Beamanator
Copy link
Contributor

@bernhardoj that fix looks great! Are you able to spin up a PR in the next hour or two if I assign you now?

@Beamanator
Copy link
Contributor

@bernhardoj Iff you are up for submitting a PR soon please do - I'll assign you when I get back online in a few hours

@bernhardoj
Copy link
Contributor

@Beamanator yes, I can open the PR immediately.

@bernhardoj
Copy link
Contributor

@Beamanator opened the PR

@Beamanator
Copy link
Contributor

Beamanator commented Nov 3, 2023 via email

@bernhardoj
Copy link
Contributor

It's all ready 👍

@hoangzinh
Copy link
Contributor

Hey @Beamanator I just got a notification that this PR #30816 is assigned to me to review. Do you need a C+ review or you can handle it?

@Beamanator
Copy link
Contributor

@hoangzinh thanks for asking, I think I'm good here since it's a nice and small PR 🙏

@Beamanator
Copy link
Contributor

CPing fix

@Beamanator Beamanator removed Reviewing Has a PR in review Weekly KSv2 labels Nov 3, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Nov 6, 2023
@melvin-bot melvin-bot bot changed the title Assign task – Unable to assign subtask in task report when create task in 1:1 DM. [HOLD for payment 2023-11-13] Assign task – Unable to assign subtask in task report when create task in 1:1 DM. Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.95-9 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-11-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

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Nov 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:

@dylanexpensify
Copy link
Contributor

Payment coming up!

@dylanexpensify
Copy link
Contributor

Payment Summary:

Upwork job invite sent! Please apply!

@bernhardoj
Copy link
Contributor

Applied

@melvin-bot melvin-bot bot added the Overdue label Nov 20, 2023
Copy link

melvin-bot bot commented Nov 21, 2023

@chiragsalian, @bernhardoj, @dylanexpensify Still overdue 6 days?! Let's take care of this!

@chiragsalian
Copy link
Contributor

Anything pending here @dylanexpensify or can we close this out?

@melvin-bot melvin-bot bot removed the Overdue label Nov 22, 2023
@dylanexpensify
Copy link
Contributor

paying out @bernhardoj! Offer sent!

@melvin-bot melvin-bot bot added the Overdue label Nov 24, 2023
Copy link

melvin-bot bot commented Nov 27, 2023

@chiragsalian, @bernhardoj, @dylanexpensify Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Nov 29, 2023

@chiragsalian, @bernhardoj, @dylanexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@chiragsalian
Copy link
Contributor

@dylanexpensify, anything pending here or can we close this out?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 29, 2023
Copy link

melvin-bot bot commented Dec 4, 2023

@chiragsalian, @bernhardoj, @dylanexpensify Eep! 4 days overdue now. Issues have feelings too...

@dylanexpensify
Copy link
Contributor

all done!

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

No branches or pull requests

7 participants