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-01-15] [$500] #focus - Task assigned to self when cancelled and read is still displayed in LHN in focus mode #33315
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: 1.4.14-1 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 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Precondition: User is in #focus mode
Go to 1:1 DM
Create a task and assign it to yourself
Open the task report
Click 3-dot menu > Cancel
Go to a different chat
Expected Result:
The task will be removed from LHN because it is read and cancelled
Actual Result:
The cancelled task is still in LHN despite in focus mode
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]#focus - Task assigned to self when cancelled and read is still displayed in LHN in focus mode[/-][+][$500] #focus - Task assigned to self when cancelled and read is still displayed in LHN in focus mode[/+]on Dec 19, 2023
Please re-state the problem that we are trying to solve in this issue.
Cancelled tasks that are read before are not hidden in focus mode
What is the root cause of that problem?
In the shouldReportBeInOptionList function, we decide whether a report should be visible in the LHN options. Inside this function, we call another function called requiresAttentionFromCurrentUser. This function requires two parameters: the report and the parentReportAction. However, in this specific case, the parentReportAction is not provided, resulting in an empty object being passed.
inside the requiresAttentionFromCurrentUser we call the isOpenTask function, which takes the report and the reportAction and returns true if the task is open and not cancelled, however in case the task is empty it still returns true even though the task is cancelled
What changes do you think we should make in order to solve the problem?
Define and pass the reportAction to the requiresAttentionFromCurrentUser function.
constreportAction=ReportActionsUtils.getReportAction(report.parentReportID??'',report.parentReportActionID??'');// Include reports that are relevant to the user in any view mode. Criteria include having a draft or having a GBR showing.// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescingif(report.hasDraft||requiresAttentionFromCurrentUser(report,reportAction)){returntrue;}
Or Alternatively, update the requiresAttentionFromCurrentUser or the isOpenTask functions to fetch the reportAction internally, since they already takes the report as an argument.
OR we can modify the isOpenTask so that it returns false in case the reportAction is empty.
changed the title [-][$500] #focus - Task assigned to self when cancelled and read is still displayed in LHN in focus mode[/-][+][HOLD for payment 2024-01-15] [$500] #focus - Task assigned to self when cancelled and read is still displayed in LHN in focus mode[/+]on Jan 10, 2024
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Dec 19, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01c072d4cdc2fc1985
[-]#focus - Task assigned to self when cancelled and read is still displayed in LHN in focus mode[/-][+][$500] #focus - Task assigned to self when cancelled and read is still displayed in LHN in focus mode[/+]melvin-bot commentedon Dec 19, 2023
Triggered auto assignment to @anmurali (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Dec 19, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Dec 19, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (
External)abzokhattab commentedon Dec 19, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Cancelled tasks that are read before are not hidden in focus mode
What is the root cause of that problem?
In the
shouldReportBeInOptionListfunction, we decide whether a report should be visible in the LHN options. Inside this function, we call another function calledrequiresAttentionFromCurrentUser. This function requires two parameters: thereportand theparentReportAction. However, in this specific case, the parentReportAction is not provided, resulting in an empty object being passed.App/src/libs/ReportUtils.ts
Lines 3510 to 3512 in e6557ae
App/src/libs/ReportUtils.ts
Line 1598 in e6557ae
inside the
requiresAttentionFromCurrentUserwe call theisOpenTaskfunction, which takes the report and the reportAction and returns true if the task is open and not cancelled, however in case the task is empty it still returns true even though the task is cancelledApp/src/libs/ReportUtils.ts
Line 538 in e6557ae
What changes do you think we should make in order to solve the problem?
Or Alternatively, update the
requiresAttentionFromCurrentUseror theisOpenTaskfunctions to fetch thereportActioninternally, since they already takes thereportas an argument.OR we can modify the
isOpenTaskso that it returns false in case the reportAction is empty.POC
Screen.Recording.2023-12-20.at.1.25.14.AM.mov
DylanDylann commentedon Dec 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The cancelled task is still in LHN despite in focus mode
What is the root cause of that problem?
after cancelling task the pusher return taskReport.isDeletedParentAction === true . But we don't add this field in this function
App/src/libs/SidebarUtils.ts
Line 232 in 7f7cfb3
What changes do you think we should make in order to solve the problem?
in this function
App/src/libs/SidebarUtils.ts
Line 232 in 7f7cfb3
we should return
isDeletedParentActionWe also need to do the same thing in the chat report selector here
App/src/pages/home/sidebar/SidebarLinksData.js
Line 170 in 7f7cfb3
should add
My solution also resolves the bug mentioned here
cc @waterim
What alternative solutions did you explore? (Optional)
Result
sol.mp4
waterim commentedon Dec 20, 2023
I tested the proposal from @DylanDylann in here and it works fine!
The issue is because data from pusher is not setting in time
23 remaining items
DylanDylann commentedon Jan 2, 2024
@alitoshmatov The PR is ready for review: #33828
mountiny commentedon Jan 10, 2024
was merged to production
[-][$500] #focus - Task assigned to self when cancelled and read is still displayed in LHN in focus mode[/-][+][HOLD for payment 2024-01-15] [$500] #focus - Task assigned to self when cancelled and read is still displayed in LHN in focus mode[/+]mountiny commentedon Jan 10, 2024
$500 to @alitoshmatov and to @DylanDylann
alitoshmatov commentedon Jan 17, 2024
This one is ready for payment
anmurali commentedon Jan 22, 2024
@alitoshmatov and @DylanDylann are paid.