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

[$500] Workspace - Avatar in chat header does not revert to default avatar after deleting workspace #30724

Closed
6 tasks done
lanitochka17 opened this issue Nov 1, 2023 · 42 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 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 1, 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!


Version Number: 1.3.94-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
Expensify/Expensify Issue URL:
**Issue reported by:**Applause - Internal Team
Slack conversation:

Issue found when executing PR #29554

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a workspace and add a custom avatar.
  3. Go to the #announce room.
  4. Go to workspace settings.
  5. Delete the workspace.
    Note that

Expected Result:

The workspace avatar in all part of the app will revert to the default avatar

Actual Result:

The custom workspace avatar in LHN and chat as well as room details page is reverted to the default avatar, except the custom avatar in the room chat header

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

Bug6259691_1698858724755.20231101_104908__1_.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @MitchExpensify
@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 Nov 1, 2023
@melvin-bot melvin-bot bot changed the title Workspace - Avatar in chat header does not revert to default avatar after deleting workspace [$500] Workspace - Avatar in chat header does not revert to default avatar after deleting workspace Nov 1, 2023
Copy link

melvin-bot bot commented Nov 1, 2023

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

Copy link

melvin-bot bot commented Nov 1, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0190689335322f5021

Copy link

melvin-bot bot commented Nov 1, 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 Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 1, 2023
Copy link

melvin-bot bot commented Nov 1, 2023

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 1, 2023

Proposal

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

Avatar in chat header does not revert to default avatar after deleting workspace

What is the root cause of that problem?

We use this memo on the outer component to prevent re-renders from parent-renders. That is the same way we used for OptionRowLHNData

export default memo(

Because report prop is passed from ReportScreen, HeaderView doesn't re-render when it is changed and the avatar of announce or admin depends on the policy but in HeaderView we don't subscribe this from Onyx which means this component doesn't re-render when the workspace avatar is changed.

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

We should subscribe policy from Onyx in HeaderView to make this component re-render when the workspace avatar is changed or the workspace is deleted.

policy: {
    key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`
},

OPTION: we can only get some necessary field of policy to make this component doesn't re-render many times. [name, avatar, pendingAction]

Because we use memo on the outer component, we should get report and personalDetails from Onyx instead of passing them from ReportScreen

What alternative solutions did you explore? (Optional)

We can pass policy from ReportScreen to HeaderView and move the memo to inside HeaderView

Result

Screen.Recording.2023-11-02.at.00.27.49.mov

@yh-0218
Copy link
Contributor

yh-0218 commented Nov 1, 2023

Proposal

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

Avatar in chat header does not revert to default avatar after deleting workspace

What is the root cause of that problem?

I think this is not relative with policy

The root cause of this problem is that we don't use memo correctly on HeaderView

export default memo(

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

We need to correct memo here

export default memo(

export default compose(
    withWindowDimensions,
    withLocalize,
    withOnyx({
        guideCalendarLink: {
            key: ONYXKEYS.ACCOUNT,
            selector: (account) => (account && account.guideCalendarLink) || null,
            initialValue: null,
        },
        parentReport: {
            key: ({report}) => `${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID || report.reportID}`,
            selector: reportWithoutHasDraftSelector,
        },
        session: {
            key: ONYXKEYS.SESSION,
        },
    }),
)(
    memo(
        HeaderView
    ),
)

What alternative solutions did you explore? (Optional)

Screen.Recording.2023-11-02.at.12.09.38.AM.mov

@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
@MitchExpensify
Copy link
Contributor

@robertKozik How do these proposals look to you?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Nov 7, 2023
@MitchExpensify
Copy link
Contributor

Friendly bump on a review of these proposals @robertKozik 🚀

@melvin-bot melvin-bot bot removed the Overdue label Nov 9, 2023
@robertKozik
Copy link
Contributor

Sorry for the delay, I'll look into the proposals today 👀

@robertKozik
Copy link
Contributor

@yh-0218 Your proposal looks promising. Could you check the performance of your change? I saw that this memo was added due to performance reason and I would not like to degradate this metric

@yh-0218
Copy link
Contributor

yh-0218 commented Nov 10, 2023

hello, @robertKozik my Proposal is updated.

@dukenv0307
Copy link
Contributor

@robertKozik Tested the proposal above and it doesn't work. I think we should subscribe policy from Onyx or if we move the memo to the below, we still need to pass the policy from ReportScreen, updated proposal for this case.

web1.mov

I think the memo is used from outer to prevent re-renders from parents re-renders. We can pass the reportID, parentReportID, policyID and then subscribe all data we need from Onyx.

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

melvin-bot bot commented Nov 14, 2023

@MitchExpensify, @robertKozik Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@robertKozik
Copy link
Contributor

Sorry for delay, on it 👀

@melvin-bot melvin-bot bot removed the Overdue label Nov 14, 2023
@yh-0218
Copy link
Contributor

yh-0218 commented Nov 14, 2023

hi, @robertKozik How about my proposal?

Copy link

melvin-bot bot commented Nov 15, 2023

@MitchExpensify @robertKozik 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!

@robertKozik
Copy link
Contributor

@yh-0218 your updated proposal doesn't work on my end. I've checked once more previous version of it, and I can encounter some unnecessary re-renders, for example when admin changed the default currency of the workspace. This info is not used inside HeaderView so shouldn't cause re-renders

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 22, 2023
@dukenv0307
Copy link
Contributor

@robertKozik The PR is ready for review.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 30, 2023
@melvin-bot melvin-bot bot changed the title [$500] Workspace - Avatar in chat header does not revert to default avatar after deleting workspace [HOLD for payment 2023-12-07] [$500] Workspace - Avatar in chat header does not revert to default avatar after deleting workspace Nov 30, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 30, 2023
Copy link

melvin-bot bot commented Nov 30, 2023

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

Copy link

melvin-bot bot commented Nov 30, 2023

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

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:

Copy link

melvin-bot bot commented Nov 30, 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:

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

@robertKozik robertKozik mentioned this issue Nov 30, 2023
59 tasks
@robertKozik
Copy link
Contributor

  • [@robertKozik] The PR that introduced the bug has been identified. Link to the PR: Memo HeaderView #30406
  • [@robertKozik] 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: https://github.com/Expensify/App/pull/30406/files#r1411286602
  • [@robertKozik] 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
  • [@robertKozik] Determine if we should create a regression test for this bug. I think there is no need for regression test
  • [@robertKozik] 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. N/A

@MitchExpensify
Copy link
Contributor

Payment summary:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 7, 2023
@MitchExpensify
Copy link
Contributor

Created an Upwork job for payment as the old one is dust: https://www.upwork.com/jobs/~01ed8ba36b00a44817

@MitchExpensify
Copy link
Contributor

Let me know when you've accepted the offer there please @dukenv0307

@melvin-bot melvin-bot bot added the Overdue label Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

@MitchExpensify, @roryabraham, @robertKozik, @dukenv0307 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@roryabraham roryabraham changed the title [HOLD for payment 2023-12-07] [$500] Workspace - Avatar in chat header does not revert to default avatar after deleting workspace [$500] Workspace - Avatar in chat header does not revert to default avatar after deleting workspace Dec 11, 2023
@roryabraham
Copy link
Contributor

Looks like we're just waiting for @dukenv0307 to accept the offer of payment so that we can close this out

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 11, 2023
@roryabraham
Copy link
Contributor

Tried DMing @dukenv0307 in slack to get this closed out. I also don't appear to have access to @MitchExpensify's view in Upwork, so I can see they're hired but it's not clear to me if they've been paid yet

@melvin-bot melvin-bot bot removed the Overdue label Dec 15, 2023
@roryabraham
Copy link
Contributor

@MitchExpensify As payment is the last todo here, I'm making you the issue owner for K2 purposes

@dukenv0307
Copy link
Contributor

dukenv0307 commented Dec 15, 2023

Thanks @roryabraham for the ping, I've accepted the offer some time ago so we're good to proceed here

@MitchExpensify
Copy link
Contributor

Sorry for the delay! Paid and contract ended

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

6 participants