You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-11-30] [$500] LHN -Task does not appear after self-assigning as a group member #26762
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.
As you can see, task report has a hiddennotificationPreference.
When user B assign a task to self, we does not set notificationPreference.
So the task report does not appear on LHN.
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.
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
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 notificationPreferencehidden 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?
We need to update in optimisticData here for editTaskAssigneeAndNavigate to follow the above notification rules
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
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.
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
Activity
melvin-bot commentedon Sep 5, 2023
Triggered auto assignment to @bfitzexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Sep 5, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)StevenKKC commentedon Sep 5, 2023
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

OpenReportAPI returns task report data as below.As you can see, task report has a
hiddennotificationPreference.When user B assign a task to self, we does not set
notificationPreference.So the task report does not appear on LHN.
App/src/components/LHNOptionsList/OptionRowLHN.js
Lines 79 to 82 in edab657
What changes do you think we should make to solve the problem?
We can set task report's
notificationPreferenceasCONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYSif task assignee is current user inTask.editTaskAssigneeAndNavigate.What alternative solutions have you investigated? (Optional)
None.
[-] 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[/+]melvin-bot commentedon Sep 7, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0153032df4672df452
melvin-bot commentedon Sep 7, 2023
Current assignee @bfitzexpensify is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Sep 7, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (
External)tienifr commentedon Sep 7, 2023
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
notificationPreferencehiddenfrom 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:
notificationPreferenceshould bealwaysnotificationPreferenceshould behiddenThis 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?
editTaskAssigneeAndNavigateto follow the above notification rulesA slightly different implementation is to add the
notificationPreferencechange in optimistic data only if the user is not owner of the task, and check if theassigneeAccountIDiscurrentUserAccountID, set toalways, otherwise, set tohiddenEditTaskAssigneeshould be fixed to follow the same rule.What alternative solutions did you explore? (Optional)
We can optionally add the
notificationPreferencewith 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.104 remaining items
techievivek commentedon Dec 5, 2023
Not overdue, payment is in progress.
bfitzexpensify commentedon Dec 5, 2023
@eVoloshchak please complete the BZ checklist when you get a chance - thanks!
bfitzexpensify commentedon Dec 8, 2023
Bump on the Bz checklist, thanks @eVoloshchak
techievivek commentedon Dec 11, 2023
Gentle bump @eVoloshchak
melvin-bot commentedon Dec 12, 2023
@eVoloshchak, @techievivek, @bfitzexpensify, @tienifr Whoops! This issue is 2 days overdue. Let's get this updated quick!
techievivek commentedon Dec 13, 2023
Not overdue, bumped @eVoloshchak on slack.
eVoloshchak commentedon Dec 13, 2023
Regression Test Proposal
Do we agree 👍 or 👎
JmillsExpensify commentedon Dec 13, 2023
$500 payment approved for @eVoloshchak based on this comment.
bfitzexpensify commentedon Dec 14, 2023
Regression steps sound good to me. Added them via https://github.com/Expensify/Expensify/issues/349649. Closing this one out, thanks everyone.