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-03-07] [$500] Workspaces - Сustom avatar is applied to all workspace rooms #35934

Closed
6 tasks done
lanitochka17 opened this issue Feb 6, 2024 · 31 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 6, 2024

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.37-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: https://expensify.testrail.io/index.php?/tests/view/4283786&group_by=cases:section_id&group_order=asc&group_id=229065
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open NewDat App and WS settings
  2. change default Avatar to the custom one
  3. check all rooms in the LHN panel

Expected Result:

Verify the Workspace chat displays the new avatar and name.
Default avatars (admins, announce) should have specific icons like at the example.

Actual Result:

All WS rooms (including admins, announce) have the same new custom avatar

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

Bug6369622_1707241367609!actual_result
Bug6369622_1707241211176.Screen_Recording_2024-02-06_at_18.36.24.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013fc2b5417b9e2c4a
  • Upwork Job ID: 1754928206561398784
  • Last Price Increase: 2024-02-13
  • Automatic offers:
    • akinwale | Contributor | 0
    • Tony-MK | Contributor | 0
@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 Feb 6, 2024
@melvin-bot melvin-bot bot changed the title Workspaces - Сustom avatar is applied to all workspace rooms [$500] Workspaces - Сustom avatar is applied to all workspace rooms Feb 6, 2024
Copy link

melvin-bot bot commented Feb 6, 2024

Job added to Upwork: https://www.upwork.com/jobs/~013fc2b5417b9e2c4a

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 6, 2024
Copy link

melvin-bot bot commented Feb 6, 2024

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

Copy link

melvin-bot bot commented Feb 6, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave6
CC @greg-schroeder

@Tony-MK
Copy link
Contributor

Tony-MK commented Feb 6, 2024

Proposal

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

Workspaces - Сustom avatar is applied to all workspace rooms

What is the root cause of that problem?

The getWorkspaceIcon function is being used for admin and announce rooms in the getIcons function.

App/src/libs/ReportUtils.ts

Lines 1543 to 1544 in 8563c0f

if (isAdminRoom(report) || isAnnounceRoom(report) || isChatRoom(report) || isArchivedRoom(report)) {
const workspaceIcon = getWorkspaceIcon(report, policy);

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

We should use getDefualtWorkspaceIcon instead for WS rooms which should only show the default workspace icon.

@ikevin127
Copy link
Contributor

Proposal

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

All WS rooms (including admins, announce) have the same new custom avatar.

What is the root cause of that problem?

Note

The WS rooms which should have default avatars: admin rooms, announce rooms, chat rooms and archived rooms.

Despite the fact that we check the WS room type here in the getIcons function:

if (isAdminRoom(report) || isAnnounceRoom(report) || isChatRoom(report) || isArchivedRoom(report)) {

The issue comes from the getWorkspaceIcon function which is called within the if mentioned above:

App/src/libs/ReportUtils.ts

Lines 1443 to 1450 in 9f37d3e

/**
* Given a report, return the associated workspace icon.
*/
function getWorkspaceIcon(report: OnyxEntry<Report>, policy: OnyxEntry<Policy> = null): Icon {
const workspaceName = getPolicyName(report, false, policy);
const policyExpenseChatAvatarSource = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar
? allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar
: getDefaultWorkspaceAvatar(workspaceName);

where we can see that regardless of the WS room type, we're always getting the avatar source from the policy?.avatar and only in case that doesn't exist we fallback to getDefaultWorkspaceAvatar.

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

Replace the logic within the WS room types check with the following:

Code spoiler
    if (isAdminRoom(report) || isAnnounceRoom(report) || isChatRoom(report) || isArchivedRoom(report)) {
        const workspaceName = getPolicyName(report, false, policy);
        const workspaceIcon: Icon = {
            source: getDefaultWorkspaceAvatar(workspaceName) ?? '',
            type: CONST.ICON_TYPE_WORKSPACE,
            name: workspaceName,
            id: -1,
        };
        return [workspaceIcon];
    }

essentially using only the part we need from the getWorkspaceIcon function.

What alternative solutions did you explore? (Optional)

Alternatively we can change the getWorkspaceIcon function by adding the check again something like:

Code spoiler
    // ... rest of the function
    let policyExpenseChatAvatarSource = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.avatar ?? getDefaultWorkspaceAvatar(workspaceName);

    if (isAdminRoom(report) || isAnnounceRoom(report) || isChatRoom(report) || isArchivedRoom(report)) {
        policyExpenseChatAvatarSource = getDefaultWorkspaceAvatar(workspaceName);
    }
    // ... rest of the function

Screenshots

MacOS: Chrome / Safari
Before After
web-before web-after

@akinwale
Copy link
Contributor

akinwale commented Feb 8, 2024

Taking over as C+ here.

@parasharrajat parasharrajat removed their assignment Feb 8, 2024
@parasharrajat
Copy link
Member

@anmurali @akinwale will be helping here as C+ while I am unavailable.

@akinwale
Copy link
Contributor

This is a fairly straightforward fix and we can move forward with @Tony-MK's proposal here since they were first to arrive at a working solution.

🎀👀🎀 C+ reviewed.

@anmurali I'll need manual assignment as C+, thanks.

Copy link

melvin-bot bot commented Feb 11, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Feb 11, 2024
Copy link

melvin-bot bot commented Feb 13, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Feb 13, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 14, 2024
Copy link

melvin-bot bot commented Feb 14, 2024

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

Copy link

melvin-bot bot commented Feb 14, 2024

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

@anmurali
Copy link

@akinwale I have assigned you and have also accepted @Tony-MK proposal as the job is now assigned to them! Let's get started!

@github-actions github-actions bot added the Hourly KSv2 label Feb 27, 2024
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.

Copy link

melvin-bot bot commented Feb 27, 2024

Current assignee @aldo-expensify is eligible for the Engineering assigner, not assigning anyone new.

@aldo-expensify
Copy link
Contributor

I created the PR to revert, is on review now

@aldo-expensify
Copy link
Contributor

TestRail should be updated
https://expensify.testrail.io/index.php?/tests/view/4283786&group_by=cases:section_id&group_order=asc&group_id=229065

Hmm it seems like the test rail steps would not have failed though, so I think this was a mistake.

I think it makes sense to update the tests to include that we should check that Rooms also get the custom avatar.

@aldo-expensify
Copy link
Contributor

Removing deploy blocker label, the revert was CP'd and tested: #37330

@aldo-expensify aldo-expensify added Daily KSv2 Hourly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Hourly KSv2 DeployBlockerCash This issue or pull request should block deployment Reviewing Has a PR in review labels Feb 27, 2024
@aldo-expensify
Copy link
Contributor

Next steps:

Pay C+ @akinwale and contributor @Tony-MK, and then we can close this out

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Feb 29, 2024
@melvin-bot melvin-bot bot changed the title [$500] Workspaces - Сustom avatar is applied to all workspace rooms [HOLD for payment 2024-03-07] [$500] Workspaces - Сustom avatar is applied to all workspace rooms Feb 29, 2024
Copy link

melvin-bot bot commented Feb 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.45-6 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 2024-03-07. 🎊

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

Copy link

melvin-bot bot commented Feb 29, 2024

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:

  • [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
  • [@akinwale] 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:
  • [@akinwale] 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:
  • [@akinwale] Determine if we should create a regression test for this bug.
  • [@akinwale] 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.
  • [@anmurali / @muttmuure] 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 Daily KSv2 Overdue labels Mar 5, 2024
@muttmuure
Copy link
Contributor

Paying now

@muttmuure
Copy link
Contributor

Paid up, no regression test as it was reverted

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

No branches or pull requests

10 participants