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

[$1000] Default profile avatar is different in tooltip #20800

Closed
6 tasks
Beamanator opened this issue Jun 15, 2023 · 34 comments
Closed
6 tasks

[$1000] Default profile avatar is different in tooltip #20800

Beamanator opened this issue Jun 15, 2023 · 34 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Needs Reproduction Reproducible steps needed Upwork Automation

Comments

@Beamanator
Copy link
Contributor

Beamanator commented Jun 15, 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. Go to any chat with default tooltip
  2. hover over profile pic

Note: This happens in multiple places in the app

Expected Result:

Profile should not be different in tooltip

Actual Result:

Profile is different in tooltip

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: main (latest)
Reproducible in staging?: N
Reproducible in production?: N
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
Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686828292914429

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cd1cc4ea3187cd31
  • Upwork Job ID: 1669689115344900096
  • Last Price Increase: 2023-06-16
@Beamanator Beamanator added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

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

@melvin-bot
Copy link

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

@s-alves10
Copy link
Contributor

I have done similar issue before(#20713) and I think I have most of the context regarding the issue. Can I work on this?

@Beamanator
Copy link
Contributor Author

@s-alves10 please do, but please provide a proposal how you think this can be fixed first 🙏

@spcheema
Copy link
Contributor

spcheema commented Jun 15, 2023

Proposed solution

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

Default profile avatar is different in tooltip

What is the root cause of that problem?

Invalid value being passed to the UserUtils.getAvatar method. Based on the recent change accountID is expected not login key

function getAvatar(avatarURL, accountID) {

    const avatarSource = UserUtils.getAvatar(avatar, actorAccountID);

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

The similar inconsistency found on multioplaces:

  • src/libs/OptionsListUtils.js line no. 840

source: UserUtils.getAvatar(personalDetail.avatar, personalDetail.login),

  • src/pages/home/report/ReactionList/BaseReactionList.js line no. 90

source: UserUtils.getAvatar(item.avatar, item.login),

  • src/components/UserDetailsTooltip/index.js line no. 22

source={UserUtils.getAvatar(userDetails.avatar, userDetails.login)}

Replace login key with accountID on all three files above listed.

What alternative solutions did you explore? (Optional)

NA

@grgia
Copy link
Contributor

grgia commented Jun 15, 2023

Avatar needs name, source, and type props for the default avatar to work. I also reported that the workspace avatars are incorrect for the same reason. I can potentially also take this one

@BhuvaneshPatil
Copy link
Contributor

Proposal

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

Default profile avatar is different in tooltip

What is the root cause of that problem?

We are using login here in UserDetailsTooltip

<View style={[styles.alignItemsCenter, styles.ph2, styles.pv2]}>
<View style={styles.emptyAvatar}>
<Avatar
containerStyles={[styles.actionAvatar]}
source={UserUtils.getAvatar(userDetails.avatar, userDetails.login)}
/>
</View>
<Text style={[styles.mt2, styles.textMicroBold, styles.textReactionSenders, styles.textAlignCenter]}>
{String(userDetails.displayName).trim() ? userDetails.displayName : ''}
</Text>
<Text style={[styles.textMicro, styles.fontColorReactionLabel]}>
{String(userDetails.login).trim() && !_.isEqual(userDetails.login, userDetails.displayName) ? Str.removeSMSDomain(userDetails.login) : ''}
</Text>
</View>

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

We shall use accountID instead

What alternative solutions did you explore? (Optional)

@s-alves10
Copy link
Contributor

I think @BhuvaneshPatil 's proposal is correct. During the last merge, UserUtils.getAvatar function changes, its 2nd parameter from login to accountID

@spcheema
Copy link
Contributor

@s-alves10 Can you please review my proposal. It requires changes on multiple files?

@spcheema
Copy link
Contributor

@grgia Yeah there are some places where changes were left unintentionally but the root cause it the same login is used instead of accountID

@twisterdotcom
Copy link
Contributor

@spcheema - can I ask about why you post comments like this on issues to begin with?

image

Just intrigued about why and whether we can improve our processes at all? Are you only able to see notifications after you comment for some reason?

It's worth noting we don't filter by the oldest proposal, only the best and if two are the same, the least recently edited, so there isn't a benefit to posting like that I'm aware of.

@twisterdotcom
Copy link
Contributor

@alex-mechler is this resolved by #20818 as well?

@alex-mechler
Copy link
Contributor

This is not @twisterdotcom

@s-alves10
Copy link
Contributor

Is this still reproducible on staging? I can't reproduce

@gadhiyamanan
Copy link
Contributor

@s-alves10 this is reproducible in dev(main branch) not in staging

@BhuvaneshPatil
Copy link
Contributor

@s-alves10 @gadhiyamanan
I just took a fresh pull of master, the bug is there (v1.3.28-4)

5.New.Expensify.Mozilla.Firefox.2023-06-15.22-54-11.mp4

@spcheema
Copy link
Contributor

spcheema commented Jun 15, 2023

@twisterdotcom Sure I will make sure not to repeats this. I was supposed to type I solution but pulled off by somethings. But agree with you.

And also at some other places I put empty comment to subscribe updates. But will make sure not to cause any kind interruptions. Thanks for highlighting

@twisterdotcom
Copy link
Contributor

No worries @spcheema! I generally use the Subscribe option to stay up to date on issues I'm not yet participating in:
image

@spcheema
Copy link
Contributor

Noted 🖋️ thank you @twisterdotcom

@twisterdotcom twisterdotcom added the Needs Reproduction Reproducible steps needed label Jun 16, 2023
@twisterdotcom
Copy link
Contributor

I can't really reproduce until it's on staging, and I still can't reproduce now:

2023-06-16_10-24-17.mp4

@Beamanator
Copy link
Contributor Author

Yeah sadly the code that potentially broke this is still in main / only the dev environment. I'll test real quick

@twisterdotcom
Copy link
Contributor

I think if it is, let's just throw External on it and assign @BhuvaneshPatil if the C+ assigned agrees.

@Beamanator
Copy link
Contributor Author

I can reproduce in main 👍

Screenshot 2023-06-16 at 12 41 21 PM

(Note: There's no email shown in my environment b/c I'm testing some other changes)

@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Jun 16, 2023
@melvin-bot melvin-bot bot changed the title Default profile avatar is different in tooltip [$1000] Default profile avatar is different in tooltip Jun 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

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

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

melvin-bot bot commented Jun 16, 2023

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

@twisterdotcom twisterdotcom added Upwork Automation and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Jun 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

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

@twisterdotcom
Copy link
Contributor

@eVoloshchak - what do you think of the proposals here?

@twisterdotcom
Copy link
Contributor

Bump @eVoloshchak to review these proposals.

@melvin-bot melvin-bot bot removed the Overdue label Jun 19, 2023
@eVoloshchak
Copy link
Contributor

@BhuvaneshPatil's proposal looks good to me, I think we should proceed with it

🎀👀🎀 C+ reviewed!
cc: @twisterdotcom

@situchan
Copy link
Contributor

This was fixed already (#21026 (comment))

@situchan
Copy link
Contributor

Latest codebase:

<Avatar
containerStyles={[styles.actionAvatar]}
source={UserUtils.getAvatar(userDetails.avatar, userDetails.accountID)}
/>

@eVoloshchak
Copy link
Contributor

Awesome, thanks @situchan!

@BhuvaneshPatil
Copy link
Contributor

Yeah, this was fixed by @Beamanator - 2a67b3e

@twisterdotcom
Copy link
Contributor

Okay, let's close then. Dupe of #21026 (comment)

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 External Added to denote the issue can be worked on by a contributor Needs Reproduction Reproducible steps needed Upwork Automation
Projects
None yet
Development

No branches or pull requests

10 participants