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

DEV: Requested or sent money message shows default profile picture #18550

Closed
6 tasks done
kavimuru opened this issue May 7, 2023 · 4 comments
Closed
6 tasks done

DEV: Requested or sent money message shows default profile picture #18550

kavimuru opened this issue May 7, 2023 · 4 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed

Comments

@kavimuru
Copy link

kavimuru commented May 7, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. change Profile picture(if it’s default Profile picture)
  2. go to any chat
  3. click on + icon
  4. select requested or sent money option
  5. request or sent any amount
  6. check the profile picture in chat

Expected Result:

should not show default profile picture

Actual Result:

default profile picture appears

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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: Dev
Reproducible in staging?: n/a
Reproducible in production?: n/a
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-05-06.at.12.42.16.PM.mov

Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683357157168249

View all open jobs on GitHub

@kavimuru kavimuru added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels May 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 7, 2023

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

@melvin-bot
Copy link

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

@Prince-Mendiratta
Copy link
Contributor

Prince-Mendiratta commented May 7, 2023

Proposal

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

In this issue, we can see that when we request / send money, the avatar shown is default even when the user has a custom profile picture.

What is the root cause of that problem?

Seems to be a regression from #18143 possibly.

To show the avatars, we use the OptionsListUtils.getAvatarsForLogins function for fetching the avatar url from the user details. The getAvatarsForLogins demands two parameters, the array of participants and the personalDetails for all users. Although we pass the array of emails, we do not pass all the user's personal details. This causes the function to return the default avatar image for the users.

/**
* Returns avatar data for a list of user logins
*
* @param {Array<String>} logins
* @param {Object} personalDetails
* @returns {Object}
*/
function getAvatarsForLogins(logins, personalDetails) {

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

In order to fix this issue, we need to pass an onyx key, ONYXKEYS.PERSONAL_DETAILS to the withOnyx function. We can then modify this line and pass the props.personalDetails as the second parameter to fix this issue.

const participantAvatars = OptionsListUtils.getAvatarsForLogins(participantEmails);

What alternative solutions did you explore? (Optional)

Optionally, we use could use the withCurrentUserPersonalDetails HOC for the same purpose.

Alternate 3
We could also use the onyx key ONYXKEYS.PERSONAL_DETAILS directly in OptionsListUtils but I would prefer the first 2 solutions.

@trjExpensify
Copy link
Contributor

Discussion on the thread here, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

3 participants