Skip to content

Task – Hidden appears as task assignee for user B when user A create a task without assignee #43833

Closed

Description

@kavimuru

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: v1.4.84-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: https://expensify.testrail.io/index.php?/tests/view/4639594
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 as user A

  3. Open group chat with user B

  4. Click on + and create a task without assignee

  5. Log in as user B (relogin if you are login already)

  6. Open group chat from step 3 and find the task from step 4

Expected Result:

Task without assignee is present in group chat after relogin

Actual Result:

Hidden appears as task assignee for user B in group chat after relogin when user A create a task without assignee. When open task details assignee is not selected. The same for task in room.

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

Bug6515731_1718623405106.task_hidden.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e57b014edbaa898b
  • Upwork Job ID: 1802723824654043156
  • Last Price Increase: 2024-06-17
Issue OwnerCurrent Issue Owner: @c3024

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Jun 17, 2024
  2. melvin-bot commented on Jun 17, 2024

    @melvin-bot

    Triggered auto assignment to @grgia (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. melvin-bot commented on Jun 17, 2024

    @melvin-bot

    Triggered auto assignment to @garrettmknight (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.

  4. github-actions commented on Jun 17, 2024

    @github-actions
    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. kavimuru commented on Jun 17, 2024

    @kavimuru
    Author

    @garrettmknight 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.

  6. kavimuru commented on Jun 17, 2024

    @kavimuru
    Author

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

  7. grgia commented on Jun 17, 2024

    @grgia
    Contributor

    What's the expected result here? @kavimuru

  8. 11 remaining items

  9. grgia commented on Jun 17, 2024

    @grgia
    Contributor

    Making external for now, but looks like there's a chance it could be an internal issue

  10. nkdengineer commented on Jun 18, 2024

    @nkdengineer
    Contributor

    Proposal

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

    Hidden appears as task assignee for user B in group chat after relogin when user A create a task without assignee. When open task details assignee is not selected. The same for task in room.

    What is the root cause of that problem?

    When user B login or user A re-login, the taskReport.managerID and action?.childManagerAccountID are undefined so taskAssigneeAccountID fallbacks to -1 and then Hidden appears. In the past, we fallback the taskAssigneeAccountID as an empty string, and when user A creates the task the optimistic assignAccountID is 0 so this bug doesn't happen.

    const taskAssigneeAccountID = Task.getTaskAssigneeAccountID(taskReport) ?? action?.childManagerAccountID ?? '-1';
    const htmlForTaskPreview =
    taskAssigneeAccountID !== 0 ? `<comment><mention-user accountid="${taskAssigneeAccountID}"></mention-user> ${taskTitle}</comment>` : `<comment>${taskTitle}</comment>`;

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

    Remove the fallback -1 here so we will not show the task assignee if it doesn't exist

    const taskAssigneeAccountID = Task.getTaskAssigneeAccountID(taskReport) ?? action?.childManagerAccountID;
    const htmlForTaskPreview =
        taskAssigneeAccountID ? `<comment><mention-user accountid="${taskAssigneeAccountID}"></mention-user> ${taskTitle}</comment>` : `<comment>${taskTitle}</comment>`;
    

    const taskAssigneeAccountID = Task.getTaskAssigneeAccountID(taskReport) ?? action?.childManagerAccountID ?? '-1';

    Or we can update this condition to not show the task assign if taskAssigneeAccountID is -1 or 0

    const taskAssigneeAccountID = Task.getTaskAssigneeAccountID(taskReport) ?? action?.childManagerAccountID ?? -1;
    taskAssigneeAccountID !== 0 && taskAssigneeAccountID !== '-1'  ? `<comment><mention-user accountid="${taskAssigneeAccountID}"></mention-user> ${taskTitle}</comment>` : `<comment>${taskTitle}</comment>`;
    
    

    https://github.com/Expensify/App/blob/b33542383ac2cb8ea1e922aa12dd2265efccd0ab/src/components/ReportActionItem/TaskPreview.tsx#L75-77

    OPTIONAL: We can also set the default value of assigneeAccountID here as undefined to be consistent with back-end

    assigneeAccountID = 0,

    What alternative solutions did you explore? (Optional)

  11. bernhardoj commented on Jun 18, 2024

    @bernhardoj
    Contributor

    This is going to be fixed in #43646

  12. grgia commented on Jun 18, 2024

    @grgia
    Contributor

    @bernhardoj in that case, can you please add these steps to the test steps/QA steps for your PR #43646

  13. bernhardoj commented on Jun 19, 2024

    @bernhardoj
    Contributor

    PR is merged, I think we can ask QA to retest this issue.

  14. melvin-bot commented on Jun 20, 2024

    @melvin-bot

    @garrettmknight, @grgia, @c3024 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  15. changed the title [-][$250] Task – Hidden appears as task assignee for user B when user A create a task without assignee[/-] [+]Task – Hidden appears as task assignee for user B when user A create a task without assignee[/+] on Jun 21, 2024
  16. grgia commented on Jun 21, 2024

    @grgia
    Contributor

    @kavimuru could you please retest this on staging?

  17. kavimuru commented on Jun 21, 2024

    @kavimuru
    Author

    @grgia Retested and not able to reproduce by the tester.

    Screenrecorder-2024-06-21-16-35-43-278.mp4
  18. grgia commented on Jun 21, 2024

    @grgia
    Contributor

    Thank you @kavimuru , closing!

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions