Skip to content

[$500] Chat - WS custom avatar is not updated in chat conversation after request money #32507

Closed

Description

@lanitochka17

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.4.8.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:

Action Performed:

  1. Launch the app
  2. Log in with any account
  3. Set your avatar to custom avatar
  4. Set your WS to custom avatar
  5. Go to Expense report
  6. Request Money

Expected Result:

WS custom avatar is updated in chat conversation after request money

Actual Result:

WS custom avatar is not updated in chat conversation after request money

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

Bug6302189_1701800461966.RPReplay_Final1701795456__1_.1.mp4

Bug6302189_1701800461936!image__33_

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01863c1504c75474be
  • Upwork Job ID: 1732107025747791872
  • Last Price Increase: 2023-12-05
  • Automatic offers:
    • shubham1206agra | Contributor | 28042361

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 5, 2023
  2. changed the title [-]Chat - WS custom avatar is not updated in chat conversation after request money[/-] [+][$500] Chat - WS custom avatar is not updated in chat conversation after request money[/+] on Dec 5, 2023
  3. melvin-bot commented on Dec 5, 2023

    @melvin-bot

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

  4. melvin-bot commented on Dec 5, 2023

    @melvin-bot
  5. melvin-bot commented on Dec 5, 2023

    @melvin-bot

    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
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 5, 2023
  7. melvin-bot commented on Dec 5, 2023

    @melvin-bot

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

  8. paultsimura commented on Dec 5, 2023

    @paultsimura
    Contributor

    Proposal

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

    The custom avatar of a workspace is not displayed, the default avatar is shown.

    What is the root cause of that problem?

    There is a broken key, by which we are trying to fetch the avatar of a workspace. The policies collection stores the keys in the format policy_${policyID}, while we try to access it by policy${policyID}. As a result, the avatar is undefined, and the fallback value of getDefaultWorkspaceAvatar(workspaceName) is returned.

    App/src/libs/ReportUtils.ts

    Lines 1168 to 1171 in 83451a8

    function getWorkspaceAvatar(report: OnyxEntry<Report>): UserUtils.AvatarSource {
    const workspaceName = getPolicyName(report, false, allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]);
    return allPolicies?.[`policy${report?.policyID}`]?.avatar ?? getDefaultWorkspaceAvatar(workspaceName);
    }

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

    In here, we should change the key policy${report?.policyID} to policy_${report?.policyID}

    App/src/libs/ReportUtils.ts

    Lines 1168 to 1171 in 83451a8

    function getWorkspaceAvatar(report: OnyxEntry<Report>): UserUtils.AvatarSource {
    const workspaceName = getPolicyName(report, false, allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]);
    return allPolicies?.[`policy${report?.policyID}`]?.avatar ?? getDefaultWorkspaceAvatar(workspaceName);
    }

    Result:

    image

    What alternative solutions did you explore? (Optional)

  9. b4s36t4 commented on Dec 5, 2023

    @b4s36t4
    Contributor

    Proposal

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

    Chat - WS custom avatar is not updated in chat conversation after request money

    What is the root cause of that problem?

    We have all the logic placed with the code, but there is some issue on how we're accessing the policy data and that's causing an issue.

    function getWorkspaceAvatar(report: OnyxEntry<Report>): UserUtils.AvatarSource {
    Here in this function we get the avatar for the respective policy.

    If we carefully observe that we're accessing the policy from allPolicies with key policy${report.policyID} but we save the policies in the following format.

    policy_${report.policyID}

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

    Updating access key with _ should solve the issue.

        return allPolicies?.[`policy_${report?.policyID}`]?.avatar ?? getDefaultWorkspaceAvatar(workspaceName);

    What alternative solutions did you explore? (Optional)

    NA

  10. aimane-chnaif commented on Dec 5, 2023

    @aimane-chnaif
    Contributor

    Asked author of offending PR since it's still within regression period

  11. added
    ReviewingHas a PR in review
    and removed on Dec 6, 2023
  12. kubabutkiewicz commented on Dec 6, 2023

    @kubabutkiewicz
    Contributor
  13. aimane-chnaif commented on Dec 6, 2023

    @aimane-chnaif
    Contributor

    @aimane-chnaif PR is ready

    cc: @shubham1206agra for review

  14. removed their assignment
    on Dec 10, 2023
  15. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 12, 2023
  16. melvin-bot commented on Dec 12, 2023

    @melvin-bot

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

  17. mountiny commented on Dec 12, 2023

    @mountiny
    Contributor

    This was a regression from another PR so I think we can actually close this issue given the PR was merged and its simple enough

  18. melvin-bot commented on Dec 13, 2023

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  19. mountiny commented on Dec 14, 2023

    @mountiny
    Contributor

    There was a regression from this PR, which was already a fix for a regression so I think we can close without payments here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions