Closed lanitochka17 closed 1 month ago
Triggered auto assignment to @twisterdotcom (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.
@twisterdotcom 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
We think that this bug might be related to #vip-vsp
Task disappears from LHN when it is not open
We only show the task report on LHN if it is opened, pinned, or the notificationPreference
is not hidden
https://github.com/Expensify/App/blob/49435db77e31fb327003cdf744e0efd60f55be48/src/libs/SidebarUtils.ts#L138-L141
If we want to always display tasks that assigned to the current user we can include isTaskAssignedToCurrentUser
in the shouldOverrideHidden
condition
const isTaskAssignedToCurrentUser = ReportUtils.isTaskReport(report) && session?.accountID === report?.managerID;
const shouldOverrideHidden = ... || isTaskAssignedToCurrentUser;
true
BE.
The reason it appears in LHN in (6) is because the task report has become unread because when you assign yourself as an assigne the lastMentionedTime
will be updated, but then it doesn't appear in step 8 because we have opened the task report and it is no more unread report.
The only thing that should be fixed here that lastMentionedTime should not be updated if a person assign himself for a task it only makes sense to assume it as a mention if a person is assigned by another user but that, I have checked, it is a BE issue can only be fixed in BE.
Sounds good @FitseTLT, gonna get a C+ to confirm.
Job added to Upwork: https://www.upwork.com/jobs/~015e6ab873971b6bf9
Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (External
)
Edited by proposal-police: This proposal was edited at 2024-08-08 05:02:02 UTC.
Task disappears from LHN
After step 6, the task report's notificationPreference
is always
:
https://github.com/Expensify/App/blob/f7e265a65f695edd85870bd0c8048cf4578e14fb/src/libs/actions/Task.ts#L584-L586
hence it appears in LHN.
After step 7, we call OpenReport
API that reset notificationPreference
to hidden
.
Hence after step 8, the task report does not appear in LHN.
We should fix that issue on BE side. A similar issue is fixed in this issue.
After the above fix, we can notice another bug, related to the GBR.
In step 5, BE sets the task report 's lastMentionedTime
to the new value but we do not do it in optimistic data, which does not match our Offline UX Patterns.
To fix that, we should set lastMentionedTime
in this:
https://github.com/Expensify/App/blob/f7e265a65f695edd85870bd0c8048cf4578e14fb/src/libs/actions/Task.ts#L578
lastMentionedTime: [assigneeAccountID, ownerAccountID].includes(currentUserAccountID) ? DateUtils.getDBTime() : undefined,
With the new expected behavior in comment, we can update: https://github.com/Expensify/App/blob/f7e265a65f695edd85870bd0c8048cf4578e14fb/src/libs/actions/Task.ts#L584-L586
notificationPreference:
[assigneeAccountID, taskOwnerAccountID].includes(currentUserAccountID) && !parentReport
? CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS
: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
with:
const parentReport = getParentReport(report);
const taskOwnerAccountID = getTaskOwnerAccountID(report);
and BE should apply the same changes.
Daily update: I'm quite busy today but definitely can review this one tomorrow morning
2. After the above fix, we can notice another bug, related to the GBR.
May I know what's the GBR bug that you mentioned?
May I know what's the GBR bug that you mentioned?
In step 5, In offline mode, we don't have the GBR when we assign the task ourselves. But in online mode, the GBR is displayed.
May I know what's the GBR bug that you mentioned?
In step 5, In offline mode, we don't have the GBR when we assign the task ourselves. But in online mode, the GBR is displayed.
Thanks, I think that's good to fix but not related to this issue 🤔 .
My two cents here, I think a task shouldn't disappear from LHN if it's a self-assigned task (We fixed a similar bug here). We can fix this from BE or update FE's shouldOverrideHidden
logic.
I think a task shouldn't disappear from LHN if it's a self-assigned task (We fixed a similar bug here).
@twisterdotcom How do you think about this one?
This isn't a bug. Tasks are like expense reports. They don't show in your LHN if you have access to the parent.
This isn't a bug. Tasks are like expense reports. They don't show in your LHN if you have access to the parent.
@hungvu193 if it is expected, so there is a bug when self-assigning as task when offline. In there, the task report is displayed in LHN.
This isn't a bug. Tasks are like expense reports. They don't show in your LHN if you have access to the parent.
@hungvu193 if it is expected, so there is a bug when self-assigning as task when offline. In there, the task report is displayed in LHN.
@puneetlath What do you think about this case?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
I agree here:
They don't show in your LHN if you have access to the parent.
But the bug shown in the video is that it is pinned with a GBR after creation and when navigating away, the task is removed from the LHN, even though it had a GBR. It's a confusing flow to show the GBR at both the highest and lowest context at once in the LHN because it feels like it shouldn't disappear.
Ahh I see, you're right. Ignore me. That does seem to be a bug.
Thanks for confirming. Waiting for proposals
@hungvu193 What do you think about my alternative solution?
App/src/libs/actions/Task.ts
I don't think that's the correct solution, remove Hidden
as notificationPreference
will make the task visible even when it doesn't have GBR. We still want to keep the task hidden if user has access to its parent and only show it if it has GBR.
@hungvu193 Thanks. I updated my alternative solution. With it:
If user can access the parent report: The task's notificationPreference
is always hidden
.
If user cannot access the parent report: The task's notificationPreference
is always
if user is the owner or assignee. Otherwise, notificationPreference
is hidden
.
if notificationPreference
is hidden
, report is not displayed in LHN, regardless it has GBR or not.
@twisterdotcom @hungvu193 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
Thanks for your update! I'll take a look today
- If user cannot access the parent report: The task's
notificationPreference
isalways
if user is the owner or assignee. Otherwise,notificationPreference
ishidden
.
Wait, is there any case that user cannot access the parent report of the task?
Wait, is there any case that user cannot access the parent report of the task?
For example, you can open the selfDM, then create a task then assign it to anyone (named user B). Then you sign in with user B. User B cannot access the selfDM (the parent report of the task).
Wait, is there any case that user cannot access the parent report of the task?
For example, you can open the selfDM, then create a task then assign it to anyone (named user B). Then you sign in with user B. User B cannot access the selfDM (the parent report of the task).
That's the user that got assigned to the task, if you create the task you should always access the parent report. Then this should be fixed from our BE.
Then this should be fixed from our BE.
Sorry, what do you mean about "this" here?
I mean this issue should be fixed from our BE.
Do you think we need to fix the issue in FE, in other words, the optimistic data. Let's take a look at the code below: https://github.com/Expensify/App/blob/f7e265a65f695edd85870bd0c8048cf4578e14fb/src/libs/actions/Task.ts#L584-L586
Now if you assign the task to yourself, we always set the notificationPreference
to always
(leads to the task report is displayed in LHN), regardless of whether the user can access the parent report or not, right?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Do you think we need to fix the issue in FE, in other words, the optimistic data. Let's take a look at the code below:
Now if you assign the task to yourself, we always set the
notificationPreference
toalways
(leads to the task report is displayed in LHN), regardless of whether the user can access the parent report or not, right?
That makes sense, however there's another issue, when you self-assign task, you see a GBR, a task with GBR shouldn't be hidden.
however there's another issue, when you self-assign task, you see a GBR, a task with GBR shouldn't be hidden
I think we need to confirm the expected behavior here. @puneetlath In above, you said
"Tasks are like expense reports. They don't show in your LHN if you have access to the parent.",
but @hungvu193 thinks:
"when you self-assign task, you see a GBR, a task with GBR shouldn't be hidden"
So when the task report has GBR, should we display it in LHN?
I do not truly understand the data hierarchy entirely, but I think if you have a GBR, and we always show the highest context for that GBR, we should show whatever report is the highest context for that GBR, even if you may not have access to the absolute highest - does that make sense?
ie, you can create a private room and then allocate tasks to individuals outside of that room. Just because that individual isn't a member of that room, if their is a task waiting on them, it should show in their LHN.
I do not truly understand the data hierarchy entirely, but I think if you have a GBR, and we always show the highest context for that GBR, we should show whatever report is the highest context for that GBR, even if you may not have access to the absolute highest - does that make sense?
I also agree with this one.
@hungvu193
User is the task's assignee and has access to parent report.
User is the task's assignee and has no access to parent report.
Your comment "however there's another issue, when you self-assign task, you see a GBR, a task with GBR shouldn't be hidden." related to the 1st case.
Currently, in LHN, we always display the parent report with GBR icon via the logic: https://github.com/Expensify/App/blob/0c8455280c738a5db596f34409a0a3177e682e7f/src/components/LHNOptionsList/OptionRowLHN.tsx#L85 https://github.com/Expensify/App/blob/0c8455280c738a5db596f34409a0a3177e682e7f/src/libs/ReportUtils.ts#L2580-L2582 it already matched @twisterdotcom 's requirement above: "we should show whatever report is the highest context for that GBR, even if you may not have access to the absolute highest"
So I think we can hide the task report in LHN.
Also, we cannot display the report that has notificationPreference
: hidden
even if it has GBR because of our logic:
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@daledah So okay, if you can prevent GBR showing on child task (user can access parent report) , then I think it's ok.
@hungvu193 Do I need to update the proposal anymore?
@daledah No need to update. Sorry for the delay, I've just tested again and @daledah 's alternative solution looks good to me! We're currently waiting for the BE data to hide the child task, meanwhile if we can access the parent task, the notification should be hidden by default. Let's update optimistic data to handle that case!
🎀 👀 🎀 C+ reviewed
Triggered auto assignment to @aldo-expensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@twisterdotcom @hungvu193 @aldo-expensify this issue is now 4 weeks old, please consider:
Thanks!
Waiting for assigning
@twisterdotcom, @hungvu193, @aldo-expensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Bump @aldo-expensify
📣 @daledah You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing 📖
@aldo-expensify I've drafted a PR to fix the FE side. Waiting for BE fix.
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: 9.0.16-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: https://expensify.testrail.io/index.php?/tests/view/4804049 Email or phone of affected tester (no customers): ponikarchuks+32824@gmail.com Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Task present in LHN
Actual Result:
Task disappears from LHN
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/user-attachments/assets/416b4d08-8df6-4e50-941f-73430e46d46b
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @hungvu193