Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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
6 tasks done
lanitochka17 opened this issue Dec 19, 2023 · 25 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 19, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 19, 2023
Copy link

melvin-bot bot commented Dec 19, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01c072d4cdc2fc1985

@melvin-bot melvin-bot bot 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 Dec 19, 2023
Copy link

melvin-bot bot commented Dec 19, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 19, 2023
Copy link

melvin-bot bot commented Dec 19, 2023

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

Copy link

melvin-bot bot commented Dec 19, 2023

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

@abzokhattab
Copy link
Contributor

abzokhattab commented 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 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

@DylanDylann
Copy link
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

@waterim
Copy link
Contributor

waterim commented 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

@abzokhattab
Copy link
Contributor

abzokhattab commented Dec 20, 2023

Considering this issue #30798 (comment), if user A assigns a task to user B and user B is on the task report page then User A canceled the task, why would we hide the task page out of the blue without leaving feedback to the user that this task is deleted. I still see that the deleted report should appear so that they get feedback on what happened then if the user navigates to another report it should be hidden.

@melvin-bot melvin-bot bot added the Overdue label Dec 22, 2023
Copy link

melvin-bot bot commented Dec 25, 2023

@anmurali, @alitoshmatov Huh... This is 4 days overdue. Who can take care of this?

@quinthar quinthar moved this to FUTURE in [#whatsnext] #vip-vsb Dec 26, 2023
Copy link

melvin-bot bot commented Dec 26, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Dec 27, 2023

@anmurali, @alitoshmatov 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Dec 29, 2023

@anmurali, @alitoshmatov Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

@alitoshmatov
Copy link
Contributor

Working on it

@melvin-bot melvin-bot bot removed the Overdue label Dec 29, 2023
@alitoshmatov
Copy link
Contributor

@abzokhattab Thank you for your proposal, I don't think your proposal correctly points out the root cause and tries to fix it with a workarounds. You are not showing why parentReportAction is not present in this specific case.

@alitoshmatov
Copy link
Contributor

@DylanDylann Thank you for your proposal. You have correct RCA. I do agree with you solution and it is straightforward.
I think we should hold, since both of the issues seem to have same root cause and could be resolved by a single solution.

@DylanDylann 's proposal looks good.

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Dec 29, 2023

Triggered auto assignment to @mountiny, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@abzokhattab
Copy link
Contributor

You are not showing why parentReportAction is not present in this specific case.

the parentReportAction is not shown because simply it was not passed to the function and it was forgotten, that's why the isOpenTask returns true

I agree that Dylan's solution will fix both issues, but have we agreed that this expected behavior here is what we want? If yes then sure let's fix both of them.

@alitoshmatov
Copy link
Contributor

@abzokhattab We can assume that is expected behavior since new issue was created #33477

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 29, 2023
Copy link

melvin-bot bot commented Dec 29, 2023

📣 @alitoshmatov 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Dec 29, 2023

📣 @DylanDylann 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added the Overdue label Jan 1, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Overdue Daily KSv2 labels Jan 2, 2024
@DylanDylann
Copy link
Contributor

@alitoshmatov The PR is ready for review: #33828

@mountiny
Copy link
Contributor

was merged to production

@mountiny mountiny 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 Jan 10, 2024
@mountiny mountiny added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Jan 10, 2024
@mountiny
Copy link
Contributor

$500 to @alitoshmatov and to @DylanDylann

@alitoshmatov
Copy link
Contributor

This one is ready for payment

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jan 17, 2024
@anmurali
Copy link

@alitoshmatov and @DylanDylann are paid.

@github-project-automation github-project-automation bot moved this from FUTURE to CRITICAL in [#whatsnext] #vip-vsb Jan 22, 2024
@melvin-bot melvin-bot bot removed the Overdue label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Status: CRITICAL
Development

No branches or pull requests

7 participants