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-08-14] [$1000] Tasks assigned disappears from LHN when leaving the chat #23309

Closed
1 of 6 tasks
kavimuru opened this issue Jul 20, 2023 · 40 comments
Closed
1 of 6 tasks
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 Needs Reproduction Reproducible steps needed Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Jul 20, 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. Login and create a task
  2. Assign to account B
  3. Login to account B
  4. Open the task
  5. Switch to other chat

Expected Result:

Task is available in LHN

Actual Result:

Task gets disappeared. Tasks that are assigned to me should be pinned in LHN in #focus mode

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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:
Reproducible in staging?: Needs reproduction
Reproducible in production?: Needs reproduction
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
image (1)
image

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0120f92e247a863177
  • Upwork Job ID: 1684316072626675712
  • 2023-07-26
  • Automatic offers:
    • hoangzinh | Contributor | 25855965
@kavimuru kavimuru added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 20, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 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

@ygshbht
Copy link
Contributor

ygshbht commented Jul 21, 2023

Proposal

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

The task assigned to a user disappears from the left-hand navigation (LHN) when the user navigates away from the task chat in focus mode.

What is the root cause of that problem?

The issue stems from the shouldReportBeInOptionList function which decides whether a report should show in 'focus' mode. Currently, there is no check to retain the report in the list if the user is the assignee of the task.

App/src/libs/ReportUtils.js

Lines 2125 to 2183 in 7fea760

function shouldReportBeInOptionList(report, currentReportId, isInGSDMode, iouReports, betas, policies, allReportActions) {
const isInDefaultMode = !isInGSDMode;
// Exclude reports that have no data because there wouldn't be anything to show in the option item.
// This can happen if data is currently loading from the server or a report is in various stages of being created.
// This can also happen for anyone accessing a public room or archived room for which they don't have access to the underlying policy.
if (
!report ||
!report.reportID ||
(_.isEmpty(report.participantAccountIDs) && !isChatThread(report) && !isPublicRoom(report) && !isArchivedRoom(report) && !isMoneyRequestReport(report) && !isTaskReport(report))
) {
return false;
}
if (!canAccessReport(report, policies, betas, allReportActions)) {
return false;
}
// Include the currently viewed report. If we excluded the currently viewed report, then there
// would be no way to highlight it in the options list and it would be confusing to users because they lose
// a sense of context.
if (report.reportID === currentReportId) {
return true;
}
// Include reports if they have a draft, are pinned, or have an outstanding IOU
// These are always relevant to the user no matter what view mode the user prefers
if (report.hasDraft || report.isPinned || hasOutstandingIOU(report, iouReports)) {
return true;
}
// Include reports that have errors from trying to add a workspace
// If we excluded it, then the red-brock-road pattern wouldn't work for the user to resolve the error
if (report.errorFields && !_.isEmpty(report.errorFields.addWorkspaceRoom)) {
return true;
}
// All unread chats (even archived ones) in GSD mode will be shown. This is because GSD mode is specifically for focusing the user on the most relevant chats, primarily, the unread ones
if (isInGSDMode) {
return isUnread(report);
}
// Archived reports should always be shown when in default (most recent) mode. This is because you should still be able to access and search for the chats to find them.
if (isInDefaultMode && isArchivedRoom(report)) {
return true;
}
// Exclude policy expense chats if the user isn't in the policy expense chat beta
if (isPolicyExpenseChat(report) && !Permissions.canUsePolicyExpenseChat(betas)) {
return false;
}
// Hide only chat threads that haven't been commented on (other threads are actionable)
if (isChatThread(report) && !report.lastMessageText) {
return false;
}
return true;
}

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

To address this issue, we could include a check within the shouldReportBeInOptionList function to determine if the user is the assignee for the task. The implementation could look like this

if (report.type === 'task') {
    if (isTaskAssignee(report)) {
        return true;
    }
}

Result:

New.Expensify.-.Google.Chrome.2023-07-21.07-17-49.mp4

@melvin-bot melvin-bot bot added the Overdue label Jul 24, 2023
@anmurali
Copy link

Rotating the assignment as I am OOO for 10 days

@melvin-bot melvin-bot bot removed the Overdue label Jul 24, 2023
@anmurali anmurali removed their assignment Jul 24, 2023
@anmurali anmurali added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 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

@melvin-bot melvin-bot bot added the Overdue label Jul 26, 2023
@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Jul 26, 2023
@melvin-bot melvin-bot bot changed the title Tasks assigned disappears from LHN when leaving the chat [$1000] Tasks assigned disappears from LHN when leaving the chat Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0120f92e247a863177

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

melvin-bot bot commented Jul 26, 2023

Current assignee @johncschuster is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@johncschuster
Copy link
Contributor

Not overdue, Melvin

@melvin-bot melvin-bot bot removed the Overdue label Jul 26, 2023
@hoangzinh
Copy link
Contributor

hoangzinh commented Jul 27, 2023

Proposal

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

Tasks assigned disappears from LHN when leaving the chat

What is the root cause of that problem?

In the focus mode, we have a logic to only show unread chat

App/src/libs/ReportUtils.js

Lines 2257 to 2260 in 0d876a4

// All unread chats (even archived ones) in GSD mode will be shown. This is because GSD mode is specifically for focusing the user on the most relevant chats, primarily, the unread ones
if (isInGSDMode) {
return isUnread(report);
}

If the report is not either opening or hasDraft or isPinned or waiting iOU action or error. We haven't had a logic to check if current report is a task that has assigned to current user, and this task is not completed yet.

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

I think the condition to show Task in focus mode is not only Task is assigned to current user, but also this Task must not be completed or cancelled yet. It's same condition when we show Green dot indicator for a task in LHN

(optionItem.isTaskReport && optionItem.isTaskAssignee && !optionItem.isCompletedTaskReport && !optionItem.isArchivedRoom));

So my proposal is:

  • We can make new util, can be called as isWaitingForTaskCompleteFromAssignee. In this util, we will check if the report is a Task and it's assigned to current user and it's still open (check still open is enough, does not need to check both not completed and not archived like when we show Green dot above). Then return true, otherwise return false.
  • We will use this util in this line

Results:

  • When the task is still open for current user:
    Screenshot 2023-07-27 at 07 00 36

  • When the task is done
    Screenshot 2023-07-27 at 07 00 56

@ArekChr
Copy link
Contributor

ArekChr commented Jul 27, 2023

Trying to reproduce this error but with no results. Could anyone send a video with the repro steps? Screens from the description are not enough

@ygshbht
Copy link
Contributor

ygshbht commented Jul 27, 2023

Sure

New.Expensify.-.Google.Chrome.2023-07-27.19-03-35.mp4

@hoangzinh
Copy link
Contributor

hoangzinh commented Jul 27, 2023

@ArekChr let try those steps

  1. Login to accountA and create a task
  2. Assign to account B
  3. Login to account B
  4. Open the task
  5. On account B, try to change to focus mode (important step)
  6. Switch to other chat

@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

📣 @hoangzinh 🎉 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 📖

@hoangzinh
Copy link
Contributor

@ArekChr @cristipaval Thanks for accepting my proposal. The PR is ready #23938. Please help me review it. Thanks ❤️

@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2023

🎯 ⚡️ Woah @ArekChr / @hoangzinh, 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 @hoangzinh got assigned: 2023-07-31 12:07:22 Z
  • when the PR got merged: 2023-08-02 09:40:22 UTC

On to the next one 🚀

@puneetlath
Copy link
Contributor

@johncschuster @hoangzinh @ArekChr can one of y'all re-test this on staging? QA is reporting that they are still experiencing the bug.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 7, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Tasks assigned disappears from LHN when leaving the chat [HOLD for payment 2023-08-14] [$1000] Tasks assigned disappears from LHN when leaving the chat Aug 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 7, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 7, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.50-3 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-08-14. 🎊

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 - N/A (@quinthar)
  • 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 Aug 7, 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:

  • [@ArekChr] The PR that introduced the bug has been identified. Link to the PR:
  • [@ArekChr] 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:
  • [@ArekChr] 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:
  • [@ArekChr] Determine if we should create a regression test for this bug.
  • [@ArekChr] 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.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@ArekChr
Copy link
Contributor

ArekChr commented Aug 8, 2023

@puneetlath Re-tested on staging, and no longer expecting this bug.

Nagranie.z.ekranu.2023-08-8.o.15.24.59.mov

@johncschuster
Copy link
Contributor

Payment to @hoangzinh has been issued!

@johncschuster
Copy link
Contributor

johncschuster commented Aug 14, 2023

@puneetlath do we need to wait on the above checklist to close this out or are we good to go?

@puneetlath
Copy link
Contributor

Given that it was a bug that we fixed, I think we should complete the checklist as we always do.

@ArekChr
Copy link
Contributor

ArekChr commented Aug 16, 2023

  • [x]: The PR that introduced the bug has been identified. Link to the PR: No bug has been identified
  • [x]: 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: n/a
  • [x]: 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: n/a
  • [x]: Determine if we should create a regression test for this bug: We can create a regression test

Regression test proposal:

  1. Log in to account A and create a task.
  2. Assign the task to account B.
  3. Log in to account B and switch to focus mode.
  4. Open the task.
  5. Switch to another chat.
  6. Verify that the task is visible on LHN.

Do we agree 👍 or 👎

@johncschuster johncschuster added the Daily KSv2 label Aug 16, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 21, 2023
@cristipaval
Copy link
Contributor

I think the only payment is for @hoangzinh. I think we can close the issue, can't we?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 21, 2023
@melvin-bot melvin-bot bot removed the Overdue label Aug 24, 2023
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 Needs Reproduction Reproducible steps needed Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants