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-05] [$500] Web - Task avatar not correct when sharing it in workspace chat #26572

Closed
1 of 6 tasks
kbecciv opened this issue Sep 2, 2023 · 38 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

Comments

@kbecciv
Copy link

kbecciv commented Sep 2, 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. Create a new workspace.
  2. Create a new task
  3. Select the share destination as the workspace chat of the current account.

Expected Result:

The workspace icon at the bottom right should be correct

Actual Result:

The workspace icon at the bottom right is invalid and only gets updated after sending a message in the task report.

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.62.0
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
Notes/Photos/Videos: Any additional supporting documentation

Screen.Recording.2023-08-27.at.7.40.40.PM.mov
Recording.4195.mp4

Expensify/Expensify Issue URL:
Issue reported by: @esh-g
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693145642005219

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e42a684a1fd73bba
  • Upwork Job ID: 1699077008312233984
  • Last Price Increase: 2023-09-19
  • Automatic offers:
    • Ollyws | Reviewer | 26767060
    • esh-g | Contributor | 26767062
    • esh-g | Reporter | 26767064
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 2, 2023

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

@melvin-bot
Copy link

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

@kbecciv
Copy link
Author

kbecciv commented Sep 2, 2023

Proposal by: @esh-g
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693145642005219

Proposal

by @esh-g

Please re-state the problem we are trying to solve

Unavailable workspace avatar is seen as subscript of a task that is shared in the ownPolicyExpenseChat

What is the root cause of this?

The root cause is that the taskReport when created optimistically, does not possess a policyID but it is a child of a policyExpenseChat so the avatar of workspace is shown but since policyID is undefined, the avatar shown is of Unavailable Workspace starting with U.
We can see in the following snippet that we are specifically handling avatar cases for WorkspaceTaskReport:

App/src/libs/ReportUtils.js

Lines 981 to 984 in 64ff471

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

What changes should be made in-order to fix this?

We should add policyID of the parent report while building optimistic data for taskReport here:

App/src/libs/ReportUtils.js

Lines 2483 to 2496 in 64ff471

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,
};
}

And this can be done by adding this line in the body of the function:

const policyID = lodashGet(allReports[`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`], 'policyID', CONST.POLICY.OWNER_EMAIL_FAKE);

Then we can just return policyID as well.
PS: Here I'm using CONST.POLICY.OWNER_EMAIL_FAKE instead of CONST.POLICY.OWNER_ACCOUNT_ID_FAKE even though it says policyID because I saw this being used in other places as well.

What other alternatives did you explore? (Optional)

  • We can have the buildOptimisticTaskReport() function accept the policyID as an argument that can be passed while creating the task.

@melvin-bot melvin-bot bot added the Overdue label Sep 5, 2023
@bfitzexpensify
Copy link
Contributor

Sending this external

@melvin-bot melvin-bot bot removed the Overdue label Sep 5, 2023
@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label Sep 5, 2023
@melvin-bot melvin-bot bot changed the title Web - Task avatar not correct when sharing it in workspace chat [$500] Web - Task avatar not correct when sharing it in workspace chat Sep 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

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

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

melvin-bot bot commented Sep 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

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

@bfitzexpensify
Copy link
Contributor

@Ollyws looks like there's a proposal in #26572 (comment) for you to review when you get a chance - thanks!

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@bfitzexpensify
Copy link
Contributor

Just making a note to myself to check if this also solves https://expensify.slack.com/archives/C049HHMV9SM/p1693280387243559 once this has been resolved

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

melvin-bot bot commented Sep 12, 2023

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

@bfitzexpensify
Copy link
Contributor

Bump to review #26572 (comment) @Ollyws - thank you!

@Ollyws
Copy link
Contributor

Ollyws commented Sep 13, 2023

Sorry for the delay, will review this asap.

@melvin-bot
Copy link

melvin-bot bot commented Sep 16, 2023

@Ollyws @bfitzexpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Sep 16, 2023
@bfitzexpensify
Copy link
Contributor

Another friendly bump on this one @Ollyws

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

Ollyws commented Sep 19, 2023

@esh-g's alternative proposal looks good to me.
🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

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

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 20, 2023
@esh-g
Copy link
Contributor

esh-g commented Sep 20, 2023

PR is here: #27853 💫

@esh-g
Copy link
Contributor

esh-g commented Sep 21, 2023

@Ollyws A duplicate issue was made by @lanitochka17 here: #27092 after the creation of this issue and they merged the PR before this

@esh-g
Copy link
Contributor

esh-g commented Sep 21, 2023

@Ollyws What do you think we should do now?

@Ollyws
Copy link
Contributor

Ollyws commented Sep 21, 2023

@esh-g In this situation ours would usually be closed as their PR has been merged but let's wait for confirmation from @luacmartins

@esh-g
Copy link
Contributor

esh-g commented Sep 21, 2023

@Ollyws @luacmartins I think a change can still be made to the solution applied currently, by setting the default value to CONST.POLICY.OWNER_EMAIL_FAKE instead of handing the case of policyID = undefined. I think this is how we handle the optimistic building of reports. Let me know what you think of this change as being more in line with the style of optimistic report building and if yes, we can merge the current PR for this issue as well.

@luacmartins
Copy link
Contributor

@esh-g yes, let's make it consistent and use OWNER_EMAIL_FAKE

@esh-g
Copy link
Contributor

esh-g commented Sep 22, 2023

@esh-g yes, let's make it consistent and use OWNER_EMAIL_FAKE

Great, I already have the changes in the PR @Ollyws

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @esh-g got assigned: 2023-09-19 23:53:04 Z
  • when the PR got merged: 2023-09-25 02:57:29 UTC
  • days elapsed: 3

On to the next one 🚀

@esh-g
Copy link
Contributor

esh-g commented Sep 25, 2023

Is melvin bot correct? Shouldn't have today been the 3rd day? I got assigned on Thursday I think.. 🤔

@luacmartins
Copy link
Contributor

I think so, I see the assignment on the 2023-09-20 7:52 UTC +8, which is the 2023-09-19 23:52 UTC
Screenshot 2023-09-26 at 9 57 53 AM

@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 28, 2023
@melvin-bot melvin-bot bot changed the title [$500] Web - Task avatar not correct when sharing it in workspace chat [HOLD for payment 2023-10-05] [$500] Web - Task avatar not correct when sharing it in workspace chat Sep 28, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 28, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 28, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.74-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-10-05. 🎊

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 28, 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:

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

@bfitzexpensify bfitzexpensify added Daily KSv2 and removed Weekly KSv2 labels Oct 3, 2023
@bfitzexpensify
Copy link
Contributor

Moving this to daily so I see and action it on 10/5

@Ollyws
Copy link
Contributor

Ollyws commented Oct 5, 2023

This was just one tiny ammendment to a PR that fixed the issue as we were working on this one, so I don't think the checklist is necessary here.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Oct 5, 2023
@bfitzexpensify
Copy link
Contributor

Agreed. OK, payments have all been finalised, so we're good to close this out - thanks everyone!

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
None yet
Development

No branches or pull requests

5 participants