Skip to content

[HOLD for payment 2023-11-13] Assign task – Unable to assign subtask in task report when create task in 1:1 DM. #30804

Closed

Description

@lanitochka17

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

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 2, 2023
  2. melvin-bot commented on Nov 2, 2023

    @melvin-bot

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

  3. melvin-bot commented on Nov 2, 2023

    @melvin-bot

    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
  4. OSBotify commented on Nov 2, 2023

    @OSBotify
    Contributor

    👋 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.
  5. melvin-bot commented on Nov 2, 2023

    @melvin-bot

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

  6. bernhardoj commented on Nov 3, 2023

    @bernhardoj
    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));
  7. Beamanator commented on Nov 3, 2023

    @Beamanator
    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?

  8. Beamanator commented on Nov 3, 2023

    @Beamanator
    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

  9. 34 remaining items

  10. melvin-bot commented on Nov 21, 2023

    @melvin-bot

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

  11. chiragsalian commented on Nov 22, 2023

    @chiragsalian
    Contributor

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

  12. dylanexpensify commented on Nov 22, 2023

    @dylanexpensify
    Contributor

    paying out @bernhardoj! Offer sent!

  13. melvin-bot commented on Nov 27, 2023

    @melvin-bot

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

  14. melvin-bot commented on Nov 29, 2023

    @melvin-bot

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

  15. chiragsalian commented on Nov 29, 2023

    @chiragsalian
    Contributor

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

  16. melvin-bot commented on Dec 4, 2023

    @melvin-bot

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

  17. dylanexpensify commented on Dec 5, 2023

    @dylanexpensify
    Contributor

    all done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions