Skip to content

[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

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!


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

  1. Go to 1:1 DM
  2. Create a task and assign it to yourself
  3. Open the task report
  4. Click 3-dot menu > Cancel
  5. 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?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

20231220_012145.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c072d4cdc2fc1985
  • Upwork Job ID: 1737225810182053888
  • Last Price Increase: 2023-12-26
  • Automatic offers:
    • alitoshmatov | Reviewer | 28072966
    • DylanDylann | Contributor | 28072967
Issue OwnerCurrent Issue Owner: @anmurali

Activity

  1. added
    External
    Daily
    Bug
    on Dec 19, 2023
  2. melvin-bot commented on Dec 19, 2023

    @melvin-bot
  3. 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
  4. melvin-bot commented on Dec 19, 2023

    @melvin-bot

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

  5. added
    Help Wanted
    on Dec 19, 2023
  6. melvin-bot commented on Dec 19, 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
  7. melvin-bot commented on Dec 19, 2023

    @melvin-bot

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

  8. abzokhattab commented on Dec 19, 2023

    @abzokhattab
    Contributor

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

    App/src/libs/ReportUtils.ts

    Lines 3510 to 3512 in e6557ae

    if (report.hasDraft || requiresAttentionFromCurrentUser(report)) {
    return true;
    }

    function requiresAttentionFromCurrentUser(optionOrReport: OnyxEntry<Report> | OptionData, parentReportAction: EmptyObject | OnyxEntry<ReportAction> = {}) {

    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

    function isOpenTaskReport(report: OnyxEntry<Report>, parentReportAction: OnyxEntry<ReportAction> | EmptyObject = {}): boolean {

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

    1. Define and pass the reportAction to the requiresAttentionFromCurrentUser function.
        const reportAction = 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-coalescing
        if (report.hasDraft || requiresAttentionFromCurrentUser(report, reportAction)) {
            return true;
        }
    1. Or Alternatively, update the requiresAttentionFromCurrentUser or the isOpenTask functions to fetch the reportAction internally, since they already takes the report as an argument.

    2. OR we can modify the isOpenTask so that it returns false in case the reportAction is empty.

    POC

    Screen.Recording.2023-12-20.at.1.25.14.AM.mov
  9. DylanDylann commented on Dec 20, 2023

    @DylanDylann
    Contributor

    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

    function getOptionData(

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

    in this function

    function getOptionData(

    we should return isDeletedParentAction

        result.isDeletedParentAction = report.isDeletedParentAction;
    
    

    We also need to do the same thing in the chat report selector here

    parentReportID: report.parentReportID,

    should add

            isDeletedParentAction: report.isDeletedParentAction
    
    

    My solution also resolves the bug mentioned here
    cc @waterim

    What alternative solutions did you explore? (Optional)

    Result

    sol.mp4
  10. waterim commented on Dec 20, 2023

    @waterim
    Contributor

    I tested the proposal from @DylanDylann in here and it works fine!
    The issue is because data from pusher is not setting in time

  11. 23 remaining items

  12. DylanDylann commented on Jan 2, 2024

    @DylanDylann
    Contributor

    @alitoshmatov The PR is ready for review: #33828

  13. mountiny commented on Jan 10, 2024

    @mountiny
    Contributor

    was merged to production

  14. 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
  15. added
    Awaiting Payment
    and removed
    Reviewing
    on Jan 10, 2024
  16. mountiny commented on Jan 10, 2024

    @mountiny
    Contributor
  17. alitoshmatov commented on Jan 17, 2024

    @alitoshmatov
    Contributor

    This one is ready for payment

  18. added
    Daily
    and removed
    Weekly
    on Jan 17, 2024
  19. anmurali commented on Jan 22, 2024

    @anmurali
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions