Skip to content
New issue

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

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

Already on GitHub? # to your account

[HOLD for payment 2023-10-02] [$500] Assign Task - Workspace avatar shows 'U' #27092

Closed
6 tasks done
lanitochka17 opened this issue Sep 9, 2023 · 32 comments
Closed
6 tasks done
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 Sep 9, 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. Launch app
  2. Tap on Workspace chat in LHN
  3. Tap plus icon
  4. Tap assign task
  5. Enter title
  6. Tap next
  7. Select assignee and assign to myself
  8. Tap confirm task
  9. Note header "U" Icon and tap on it to note the details

Expected Result:

Workspace is available, so it must not show unavailable icon and it must show workspace profile icon after assigning a task

Actual Result:

Workspace is available, but it shows unavailable icon instead of workspace profile icon in header after assigning a task

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: 1.3.66-3

Reproducible in staging?: No

Reproducible in production?: No

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

Bug6193614_unavailable.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a3f658f7ff3bedd3
  • Upwork Job ID: 1701125975388905472
  • Last Price Increase: 2023-09-11
  • Automatic offers:
    • dukenv0307 | Contributor | 26727093
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 9, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 9, 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

@spcheema
Copy link
Contributor

spcheema commented Sep 10, 2023

Proposed solution

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

Assign Task - Workspace avatar shows 'U'

What is the root cause of that problem?**

When a task report is created in the Workspace chat, the policy ID is not linked to the report object unless we chat report is reloaded. (backend report police ID)

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

We can check if the policy isn't defined and then get it from the parent report in the similar way the subtitle (getParentNavigationSubtitle) in the header is created From Beanstalk In Beanstalk

App/src/libs/ReportUtils.js

Lines 1707 to 1717 in b11bddc

function getParentNavigationSubtitle(report) {
if (isThread(report)) {
const parentReport = lodashGet(allReports, [`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID}`]);
const {rootReportName, workspaceName} = getRootReportAndWorkspaceName(parentReport);
if (_.isEmpty(rootReportName)) {
return {};
}
return {rootReportName, workspaceName};
}
return {};

Add below condition inside ReportUtils.getIcons function

        if (isWorkspaceTaskReport(report)) {
            //If the policy is not available then retrieve from parent report
+            if (!policy)
+            {
+                const parentReport = getParentReport(report)  // further check for parent report will be added  
+                policy = getPolicy(parentReport.policyID)
+            }

            const workspaceIcon = getWorkspaceIcon(report, policy);
            return [ownerIcon, workspaceIcon];
        }

What alternative solutions did you explore? (Optional)

Make sure the policy ID is added to the task report object when the report is created. I believe this is something feasible since the policy is available offline.

Before change: https://www.loom.com/share/c463b1c166924b27b833d84da4895d63?sid=2e342bd5-6046-4f29-812a-9da8d410680b

After change: https://www.loom.com/share/63811ee868ff40fbb0fe2aad66d1a3e5?sid=e6aac6e1-0ea1-451e-9087-65c29597371c

@dukenv0307
Copy link
Contributor

dukenv0307 commented Sep 11, 2023

Proposal

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

Assign Task - Workspace avatar shows 'U'

What is the root cause of that problem?

When we create a task, we don't add policyID for taskReport in optimisticTaskReport

App/src/libs/ReportUtils.js

Lines 2594 to 2607 in f896f71

function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parentReportID, title, description) {
return {
reportID: generateReportID(),
reportName: title,
description,
ownerAccountID,
participantAccountIDs: assigneeAccountID && assigneeAccountID !== ownerAccountID ? [assigneeAccountID] : [],
managerID: assigneeAccountID,
type: CONST.REPORT.TYPE.TASK,
parentReportID,
stateNum: CONST.REPORT.STATE_NUM.OPEN,
statusNum: CONST.REPORT.STATUS.OPEN,
};
}

That makes getPolicyName function return Unavailable workspace

const policyName = lodashGet(finalPolicy, 'name') || report.policyName || report.oldPolicyName || noPolicyFound;

And the icon is wrong

const policyExpenseChatAvatarSource = lodashGet(allPolicies, [`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`, 'avatar']) || getDefaultWorkspaceAvatar(workspaceName);

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

We should add policyID for taskReport if the parentReport is policyExpense or always pass parentReport.policyID.

  1. In createTaskAndNavigate and buildOptimisticTaskReport function, add an extra param policyID
function createTaskAndNavigate(parentReportID, title, description, assigneeEmail, assigneeAccountID = 0, assigneeChatReport = null, policyID = undefined)

function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parentReportID, title, description, policyID = undefined)
  1. In buildOptimisticTaskReport, we will return policyID if the policyID is not undefined
...(_.isUndefined(policyID) ? {} : {policyID})
  1. In createTaskAndNavigate function, pass the policyID into the buildOptimisticTaskReport function
const optimisticTaskReport = ReportUtils.buildOptimisticTaskReport(currentUserAccountID, assigneeAccountID, parentReportID, title, description, policyID);

const optimisticTaskReport = ReportUtils.buildOptimisticTaskReport(currentUserAccountID, assigneeAccountID, parentReportID, title, description);

4. In NewTaskPage, we will pass policyID to createTaskAndNavigate function

Task.createTaskAndNavigate(parentReport.reportID, props.task.title, props.task.description, props.task.assignee, props.task.assigneeAccountID, props.task.assigneeChatReport, parentReport.policyID || undefined);

Task.createTaskAndNavigate(parentReport.reportID, props.task.title, props.task.description, props.task.assignee, props.task.assigneeAccountID, props.task.assigneeChatReport);

What alternative solutions did you explore? (Optional)

NA

Result

Screencast.from.11-09-2023.11.55.01.webm

@adelekennedy
Copy link

reproduced

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Sep 11, 2023
@melvin-bot melvin-bot bot changed the title Assign Task - Workspace avatar shows 'U' [$500] Assign Task - Workspace avatar shows 'U' Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

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

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 13, 2023
@adelekennedy
Copy link

@sobitneupane thoughts on the proposal above?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 13, 2023
@sobitneupane
Copy link
Contributor

Thanks for the proposal everyone.

Proposal from @dukenv0307 looks good to me.

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

@spcheema
Copy link
Contributor

@sobitneupane but I proposed the same change in the alternative solution.

@spcheema
Copy link
Contributor

It's just code diff is missing which we are discouraged to add

@luacmartins
Copy link
Contributor

I agree that @dukenv0307's proposal is better and more detailed.

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

melvin-bot bot commented Sep 18, 2023

📣 @sobitneupane Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

📣 @dukenv0307 🎉 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 Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 25, 2023
@melvin-bot melvin-bot bot changed the title [$500] Assign Task - Workspace avatar shows 'U' [HOLD for payment 2023-10-02] [$500] Assign Task - Workspace avatar shows 'U' Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 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 Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 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-02. 🎊

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 Sep 25, 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:

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

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 1, 2023
@luacmartins
Copy link
Contributor

Just waiting on payment

@melvin-bot melvin-bot bot removed the Overdue label Oct 3, 2023
@adelekennedy
Copy link

Payouts due:

Contributor: $500 @dukenv0307 (Upwork)
Contributor+: $500 @sobitneupane (NewDot)

Eligible for 50% #urgency bonus? Y

Upwork job is here.

@sobitneupane
Copy link
Contributor

sobitneupane commented Oct 9, 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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

#17992

  • [@sobitneupane] 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:

#17992 (comment)

  • [@sobitneupane] 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:

This is a case missed while adding a new feature.

  • [@sobitneupane] Determine if we should create a regression test for this bug.

Yes.

  • [@sobitneupane] 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.

#27092 (comment)

@sobitneupane
Copy link
Contributor

Regression Test Proposal

  1. Login with any account
  2. Create a workspace
  3. Go to the workspace chat
  4. Create a task in this chat report
  5. Verify the header of the task report displays the correct workspace instead of the unavailable workspace

Do we agree 👍 or 👎

@sobitneupane
Copy link
Contributor

#27092 (comment)

Eligible for 50% #urgency bonus? Y

Since it is eligible for urgency bonus. Requested $750 for payment in newDot.

@JmillsExpensify
Copy link

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

@JmillsExpensify
Copy link

Also re-opening this one for the regression test.

@melvin-bot melvin-bot bot added the Overdue label Oct 12, 2023
@adelekennedy
Copy link

pending regression test feedback

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

@luacmartins, @sobitneupane, @adelekennedy, @dukenv0307 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@luacmartins
Copy link
Contributor

I don't think we need a specific regression test for this since it's an UI issue that's easily noticeable. I think we're good to close.

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
# for free to join this conversation on GitHub. Already have an account? # 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
None yet
Development

No branches or pull requests

8 participants