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 2023-10-09] [Awaiting payment Oct 2 2023 / $500] Web - green dot appears even if task is deleted #27805

Closed
1 of 6 tasks
kbecciv opened this issue Sep 19, 2023 · 34 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Sep 19, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to any chat
  2. Click on + icon and select assign task
  3. Enter title and assign task to you
  4. Create task
  5. Go to task thread and delete the task

Expected Result:

should not show green dot show if task is deleted

Actual Result:

green dot appears even if task is deleted

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: Dev 1.3.71-5
Reproducible in staging?: Y
Reproducible in production?: n
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
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-09-19.at.12.19.29.PM.mov

Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695106297939429

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01833b320ff7bd97a7
  • Upwork Job ID: 1704197379523981312
  • Last Price Increase: 2023-09-19
  • Automatic offers:
    • paultsimura | Contributor | 26790441
    • gadhiyamanan | Reporter | 26790444
@kbecciv kbecciv added the External Added to denote the issue can be worked on by a contributor label Sep 19, 2023
@melvin-bot melvin-bot bot changed the title Dev: Web - green dot appears even if task is deleted [$500] Dev: Web - green dot appears even if task is deleted Sep 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01833b320ff7bd97a7

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

melvin-bot bot commented Sep 19, 2023

Triggered auto assignment to @michaelhaxhiu (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

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

@paultsimura
Copy link
Contributor

paultsimura commented Sep 19, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

The green dot is displayed in LHN for deleted task

What is the root cause of that problem?

Here we check for the optionItem.isArchivedRoom to check if the task is closed. The archival logic was removed now.

const shouldShowGreenDotIndicator =
!hasBrickError &&
(optionItem.isUnreadWithMention ||
ReportUtils.isWaitingForIOUActionFromCurrentUser(optionItem) ||
(optionItem.isTaskReport && optionItem.isTaskAssignee && !optionItem.isCompletedTaskReport && !optionItem.isArchivedRoom));

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

We need to check for optionItem.isOpenTaskReport instead:

    const shouldShowGreenDotIndicator =
        !hasBrickError &&
        (optionItem.isUnreadWithMention ||
            ReportUtils.isWaitingForIOUActionFromCurrentUser(optionItem) ||
-           (optionItem.isTaskReport && optionItem.isTaskAssignee && !optionItem.isCompletedTaskReport && !optionItem.isArchivedRoom))
+           (optionItem.isOpenTaskReport && optionItem.isTaskAssignee));

Add in SidebarUtils:

    if (result.isTaskReport) {
+       result.isOpenTaskReport = ReportUtils.isOpenTaskReport(report);
-       result.isCompletedTaskReport = ReportUtils.isCompletedTaskReport(report);
        result.isTaskAssignee = ReportUtils.isReportManager(report);
    }

if (result.isTaskReport) {
result.isCompletedTaskReport = ReportUtils.isCompletedTaskReport(report);
result.isTaskAssignee = ReportUtils.isReportManager(report);
}

Result:

https://www.loom.com/share/4e2f44055ded410ea5dfe9bef3368db8?sid=1c7304e3-39be-47b6-8685-2b6bd517ce21

What alternative solutions did you explore? (Optional)

@abzokhattab
Copy link
Contributor

abzokhattab commented Sep 19, 2023

Proposal

The green dot is displayed in LHN for deleted task

What is the root cause of that problem?

we are not checking if the task is canceled in the green flag assignment

const shouldShowGreenDotIndicator =
!hasBrickError &&
(optionItem.isUnreadWithMention ||
ReportUtils.isWaitingForIOUActionFromCurrentUser(optionItem) ||
(optionItem.isTaskReport && optionItem.isTaskAssignee && !optionItem.isCompletedTaskReport && !optionItem.isArchivedRoom));

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

we should check if the task is not cancelled as well

    const shouldShowGreenDotIndicator =
        !hasBrickError &&
        (optionItem.isUnreadWithMention ||
            ReportUtils.isWaitingForIOUActionFromCurrentUser(optionItem) ||
            (optionItem.isTaskReport && optionItem.isTaskAssignee && !optionItem.isCompletedTaskReport && !optionItem.isCanceledTaskReport && !optionItem.isArchivedRoom));

and of course add the isCanceledTaskReport object to the SideBarUtils.js in line 268 to enable the OptionRowLHN to access it

    if (result.isTaskReport) {
        result.isCompletedTaskReport = ReportUtils.isCompletedTaskReport(report);
        result.isCanceledTaskReport = ReportUtils.isCanceledTaskReport(report);
        result.isTaskAssignee = ReportUtils.isReportManager(report);
    }

POC:

image

@rojiphil
Copy link
Contributor

Not able to reproduce in latest main - v1.3.71-11

@paultsimura
Copy link
Contributor

Still reproducible on 1.3.71-13

image

@rojiphil
Copy link
Contributor

Oops! Sorry @paultsimura. I can also reproduce it. Thanks for the verification.

@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@allroundexperts
Copy link
Contributor

I think @paultsimura's approach is more simpler. Let's go with there proposal.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

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

@jasperhuangg jasperhuangg added DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 and removed Daily KSv2 labels Sep 21, 2023
@jasperhuangg
Copy link
Contributor

It seems this bug has made its way onto staging and isn't only specific to dev now.

@jasperhuangg jasperhuangg changed the title [$500] Dev: Web - green dot appears even if task is deleted [$500] Web - green dot appears even if task is deleted Sep 21, 2023
@OSBotify
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

Current assignee @tgolen is eligible for the Engineering assigner, not assigning anyone new.

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

The PR is ready for review

@paultsimura
Copy link
Contributor

Please note: when canceling a task on one device, there is a buggy behavior in another: you have to open the task thread in order to fetch the actual state of the task. But it's a different issue as after the thread was opened, both the LHN title and green indicator are fixed.

image image

@thienlnam thienlnam removed the DeployBlockerCash This issue or pull request should block deployment label Sep 21, 2023
@thienlnam
Copy link
Contributor

Going to remove the blocker on this as it's not a common flow right now and doesn't need to block deploy

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

🎯 ⚡️ Woah @allroundexperts / @paultsimura, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @paultsimura got assigned: 2023-09-21 05:33:33 Z
  • when the PR got merged: 2023-09-25 22:24:23 UTC

On to the next one 🚀

@michaelhaxhiu
Copy link
Contributor

Weird, the payment window wasn't added automatically. 🤔 Should be 7 days after the PR's deploy to watch for regressions.

@michaelhaxhiu michaelhaxhiu changed the title [$500] Web - green dot appears even if task is deleted [Awaiting payment Oct 2 2023 / $500] Web - green dot appears even if task is deleted Sep 27, 2023
@michaelhaxhiu michaelhaxhiu added the Bug Something is broken. Auto assigns a BugZero manager. label Sep 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 27, 2023

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 27, 2023
@michaelhaxhiu michaelhaxhiu removed their assignment Sep 27, 2023
@Expensify Expensify deleted a comment from melvin-bot bot Sep 27, 2023
@michaelhaxhiu
Copy link
Contributor

I'm handing this off to another BZ as I'm going on sabbatical by end of week, and want to ensure this is paid.

Next steps are as follows:

@flaviadefaria
Copy link
Contributor

@paultsimura you've been paid
@gadhiyamanan please accept the offer so that I can pay you.

@gadhiyamanan
Copy link
Contributor

@flaviadefaria offer accepted, thanks!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Oct 2, 2023
@melvin-bot melvin-bot bot changed the title [Awaiting payment Oct 2 2023 / $500] Web - green dot appears even if task is deleted [HOLD for payment 2023-10-09] [Awaiting payment Oct 2 2023 / $500] Web - green dot appears even if task is deleted Oct 2, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-09. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@allroundexperts] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@flaviadefaria] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/322364

@allroundexperts
Copy link
Contributor

Reviewer Checklist

  1. Show green dot for uncompleted tasks assigned to current user #20808
  2. https://github.com/Expensify/App/pull/20808/files#r1343276213
  3. I think a Slack discussion is not needed since this could have been caught only by better testing.
  4. Regression test would be helpful here.

Regression Test Steps

  1. Go to any chat and create task and assign it to yourself.
  2. Go to the created task and cancel it.

Verify that a green dot does not show up in the LHN beside the task item.

Do we 👍 or 👎 ?

@JmillsExpensify
Copy link

$750 payment approved for @allroundexperts based on BZ summary.

@flaviadefaria
Copy link
Contributor

Alright, I believe everyone has been paid so closing this.

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. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests