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 2024-07-17] [$250] Task – Green dot disappears with a delay in LHN when task is completed #44087
@zanyrenney 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
isUnreadWithMention will be true if the lastReadTime is smaller than the lastMentionedTime. A new task report doesn't have a lastReadTime. When we assign a task to ourselves, a new message is shown assigned to {mention}
which adds a mention to ourselves. So, the lastMentionedTime returns from the EditTaskAssignee API.
Because the lastReadTime is empty and defaults to an empty string, it's smaller than the lastMentionedTime. This makes the LHN title bold too (unread).
When we complete the task, isWaitingForAssigneeToCompleteTask returns false, but isUnreadWithMention still returns true. After a few seconds, the CompleteTask API returns the up-to-date lastReadTime which hides the green dot.
What changes do you think we should make in order to solve the problem?
I think we have 2 issues here. The LHN becomes unread when assigning a task to ourselves and the green dot and unread don't immediately disappear after completing a task.
To fix the second issue, we can optimistically set a lastReadTime when completing the task.
For the first issue, I think it requires both FE and BE fix. On FE, we can optimistically update the lastReadTime just like above when editing the assignee (or other fields). However, this isn't enough because the lastMentionedTime from EditTaskAssignee will still be bigger than the optimistic lastReadTime. So, I think the EditTaskAssignee API should return both lastReadTime and lastMentionedTime and have them at least equal.
changed the title [-]Task – Green dot disappears with a delay in LHN when task is completed[/-][+][$250] Task – Green dot disappears with a delay in LHN when task is completed[/+]on Jun 21, 2024
changed the title [-][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Task – Green dot disappears with a delay in LHN when task is completed[/-][+][HOLD for payment 2024-07-17] [$250] Task – Green dot disappears with a delay in LHN when task is completed[/+]on Jul 19, 2024
@allroundexperts requires payment through NewDot Manual Requests - please request $250 via ND @bernhardoj requires payment automatic offer (Contributor) - please ignore upwork offer as i see you are paid via ND. please request $250 via ND
I was not able to pinpoint any specific PR which caused this. The logic for green dot is dependent on many conditions and it is highly likely that multiple changes lead up to this.
N/A
N/A
A regression test would be helpful here.
Regression test
Open the app and login as user A
Create a room and add a user B to it
Create a task in the room and do not add any assignee to it
Login as user B
Open the task that was created in step 3 and assign it to yourself
Find task in LHN and verify green dot appears
Mark task as complete
Verify that the green dot disappears without delay in LHN when task is completed
Activity
melvin-bot commentedon Jun 20, 2024
Triggered auto assignment to @zanyrenney (
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.m-natarajan commentedon Jun 20, 2024
@zanyrenney 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
m-natarajan commentedon Jun 20, 2024
We think that this bug might be related to #vip-vsb
bernhardoj commentedon Jun 21, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The green dot in LHN doesn't immediately disappear when completing a task.
What is the root cause of that problem?
There are multiple conditions for the green dot to show, but in our case, we just focus on these 2 conditions.
App/src/libs/ReportUtils.ts
Lines 2316 to 2322 in 633e708
isUnreadWithMentionwill be true if thelastReadTimeis smaller than thelastMentionedTime. A new task report doesn't have alastReadTime. When we assign a task to ourselves, a new message is shownassigned to {mention}which adds a mention to ourselves. So, the
lastMentionedTimereturns from the EditTaskAssignee API.Because the
lastReadTimeis empty and defaults to an empty string, it's smaller than thelastMentionedTime. This makes the LHN title bold too (unread).App/src/libs/ReportUtils.ts
Lines 2288 to 2290 in 633e708
When we complete the task,

isWaitingForAssigneeToCompleteTaskreturns false, butisUnreadWithMentionstill returns true. After a few seconds, the CompleteTask API returns the up-to-datelastReadTimewhich hides the green dot.What changes do you think we should make in order to solve the problem?
I think we have 2 issues here. The LHN becomes unread when assigning a task to ourselves and the green dot and unread don't immediately disappear after completing a task.
To fix the second issue, we can optimistically set a
lastReadTimewhen completing the task.App/src/libs/actions/Task.ts
Lines 302 to 315 in 633e708
(and revert it back when it fails)
For the first issue, I think it requires both FE and BE fix. On FE, we can optimistically update the
lastReadTimejust like above when editing the assignee (or other fields). However, this isn't enough because thelastMentionedTimefromEditTaskAssigneewill still be bigger than the optimisticlastReadTime. So, I think theEditTaskAssigneeAPI should return bothlastReadTimeandlastMentionedTimeand have them at least equal.zanyrenney commentedon Jun 21, 2024
Yes this looks VSB related, lets get this fixed!
[-]Task – Green dot disappears with a delay in LHN when task is completed[/-][+][$250] Task – Green dot disappears with a delay in LHN when task is completed[/+]melvin-bot commentedon Jun 21, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01fd4e242d6ffc4ea6
melvin-bot commentedon Jun 21, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (
External)melvin-bot commentedon Jun 24, 2024
@allroundexperts, @zanyrenney Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
34 remaining items
bernhardoj commentedon Jul 17, 2024
Requested in ND
[-][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Task – Green dot disappears with a delay in LHN when task is completed[/-][+][HOLD for payment 2024-07-17] [$250] Task – Green dot disappears with a delay in LHN when task is completed[/+]zanyrenney commentedon Jul 19, 2024
payment summary
@allroundexperts requires payment through NewDot Manual Requests - please request $250 via ND
@bernhardoj requires payment automatic offer (Contributor) - please ignore upwork offer as i see you are paid via ND. please request $250 via ND
JmillsExpensify commentedon Jul 19, 2024
$250 approved for @bernhardoj
allroundexperts commentedon Jul 28, 2024
Checklist
Regression test
Verify that the green dot disappears without delay in LHN when task is completed
Do we 👍 or 👎 ?
JmillsExpensify commentedon Aug 21, 2024
$250 approved for @allroundexperts
JmillsExpensify commentedon Aug 21, 2024
Opening this back up for the regression test.
zanyrenney commentedon Aug 22, 2024
My b, thanks @JmillsExpensify