Skip to content

[HOLD for payment 2023-11-30] [$500] LHN -Task does not appear after self-assigning as a group member #26762

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!


Action Performed:

  1. Open the app and log in
  2. As user A create a group with user B
  3. Create a task without assignee
  4. Log in as user B and assign the ask to yourself

Expected Result:

The task is displayed in the LHN

Actual Result:

The task is not shown in the LHN until a comment is added to the task or draft is created

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.63-0

Reproducible in staging?: Y

Reproducible in production?: Y

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

Bug6188734_video_2023-09-05_01-10-35.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/~0153032df4672df452
  • Upwork Job ID: 1699725002288009216
  • Last Price Increase: 2023-09-14
  • Automatic offers:
    • StevenKKC | Contributor | 26755200
    • tienifr | Contributor | 26771899

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 5, 2023
  2. melvin-bot commented on Sep 5, 2023

    @melvin-bot

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

  3. melvin-bot commented on Sep 5, 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. StevenKKC commented on Sep 5, 2023

    @StevenKKC
    Contributor

    Proposal

    Please state again the problem we are trying to solve in this issue.

    Task does not appear on LHN after self-assigning as a group member

    What is the cause of this issue?

    After user A create a task without assignee, on user B side OpenReport API returns task report data as below.
    Screenshot 2023-09-05 115522
    As you can see, task report has a hidden notificationPreference.

    When user B assign a task to self, we does not set notificationPreference.
    So the task report does not appear on LHN.

    const isHidden = optionItem.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN;
    if (isHidden && !props.isFocused && !optionItem.isPinned) {
    return null;
    }

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

    We can set task report's notificationPreference as CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS if task assignee is current user in Task.editTaskAssigneeAndNavigate.

        const optimisticData = [
            ...
            {
                onyxMethod: Onyx.METHOD.MERGE,
                key: `${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`,
                value: {
                    ...
                    notificationPreference: assigneeAccountID === currentUserAccountID ? CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS : report.notificationPreference,
                },
            },
        ];

    What alternative solutions have you investigated? (Optional)

    None.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 7, 2023
  6. changed the title [-] LHN -Task does not appear after self-assigning as a group member[/-] [+][$500] LHN -Task does not appear after self-assigning as a group member[/+] on Sep 7, 2023
  7. melvin-bot commented on Sep 7, 2023

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 7, 2023
  9. melvin-bot commented on Sep 7, 2023

    @melvin-bot

    Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new.

  10. melvin-bot commented on Sep 7, 2023

    @melvin-bot

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

  11. tienifr commented on Sep 7, 2023

    @tienifr
    Contributor

    Proposal

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

    The task is not shown in the LHN until a comment is added to the task or draft is created

    What is the root cause of that problem?

    For non-assignee of the task, we're setting the task report with notificationPreference hidden from the back-end so that it doesn't appear in the LHN and distract the user, but we're not updating it when assigning the task in both BE and optimistic data.

    The correct notification settings for tasks should be:

    • For owner and assignee of the task, notificationPreference should be always
    • For others, notificationPreference should be hidden
      This is already working when we create the task, but not working when editing the assignee of the task.

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

    1. We need to update in optimisticData here for editTaskAssigneeAndNavigate to follow the above notification rules
    notificationPreference: [assigneeAccountID, ownerAccountID].includes(currentUserAccountID) ? CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS : CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
    

    A slightly different implementation is to add the notificationPreference change in optimistic data only if the user is not owner of the task, and check if the assigneeAccountID is currentUserAccountID, set to always, otherwise, set to hidden

    1. The back-end for EditTaskAssignee should be fixed to follow the same rule.

    What alternative solutions did you explore? (Optional)

    We can optionally add the notificationPreference with the same above logic to the optimistic data of the create task as well, to be consistent. But that doesn't cause any issue for now.

  12. 104 remaining items

  13. techievivek commented on Dec 5, 2023

    @techievivek
    Contributor

    Not overdue, payment is in progress.

  14. bfitzexpensify commented on Dec 5, 2023

    @bfitzexpensify
    Contributor

    @eVoloshchak please complete the BZ checklist when you get a chance - thanks!

  15. bfitzexpensify commented on Dec 8, 2023

    @bfitzexpensify
    Contributor

    Bump on the Bz checklist, thanks @eVoloshchak

  16. techievivek commented on Dec 11, 2023

    @techievivek
    Contributor

    Gentle bump @eVoloshchak

  17. melvin-bot commented on Dec 12, 2023

    @melvin-bot

    @eVoloshchak, @techievivek, @bfitzexpensify, @tienifr Whoops! This issue is 2 days overdue. Let's get this updated quick!

  18. techievivek commented on Dec 13, 2023

    @techievivek
    Contributor

    Not overdue, bumped @eVoloshchak on slack.

  19. eVoloshchak commented on Dec 13, 2023

    @eVoloshchak
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: there isn't a PR that caused this, this is the original implementation for both back- and frontend
    • 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: N/A
    • 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: I don't think an additional discussion is needed here

    Regression Test Proposal

    1. Login with A and B
    2. On A, go to a group chat with B as a member
    3. Create a task without assignee
    4. On B, self-assign the task
    5. Verify that the task report is displayed in LHN

    Do we agree 👍 or 👎

  20. JmillsExpensify commented on Dec 13, 2023

    @JmillsExpensify
    Contributor

    $500 payment approved for @eVoloshchak based on this comment.

  21. bfitzexpensify commented on Dec 14, 2023

    @bfitzexpensify
    Contributor

    Regression steps sound good to me. Added them via https://github.com/Expensify/Expensify/issues/349649. Closing this one out, thanks everyone.

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.DailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staff

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions