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 App #22500] DEV : Incorrect tooltip on Invite members page #22513

Closed
1 of 6 tasks
kavimuru opened this issue Jul 9, 2023 · 18 comments
Closed
1 of 6 tasks

[HOLD App #22500] DEV : Incorrect tooltip on Invite members page #22513

kavimuru opened this issue Jul 9, 2023 · 18 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Needs Reproduction Reproducible steps needed Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Jul 9, 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 Settings > Workspaces > select any workspace
  2. Go to Members > Invite
  3. Hover user avatar in any option row

Expected Result:

Tooltip shows with avatar, email and display name

Actual Result:

Tooltip shows only avatar

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

bug.4.mov

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

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 Jul 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 9, 2023

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

@melvin-bot
Copy link

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

@kavimuru
Copy link
Author

kavimuru commented Jul 9, 2023

Proposal

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

Incorrect tooltip on Invite members page

What is the root cause of that problem?

#21696 was reverted in recent PR. So when get icons without report, fallbackIcon returns -1 as id

App/src/libs/ReportUtils.js

Lines 807 to 816 in 60f4817

function getIcons(report, personalDetails, defaultIcon = null, isPayer = false) {
if (_.isEmpty(report)) {
const fallbackIcon = {
source: defaultIcon || Expensicons.FallbackAvatar,
type: CONST.ICON_TYPE_AVATAR,
name: '',
id: -1,
};
return [fallbackIcon];
}

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

Add #21696 back:

function getIcons(report, personalDetails, defaultIcon = null, isPayer = false, defaultName = '', defaultAccountID = -1) {
    if (_.isEmpty(report)) {
        const fallbackIcon = {
            source: defaultIcon || Expensicons.FallbackAvatar,
            type: CONST.ICON_TYPE_AVATAR,
            name: defaultName,
            id: defaultAccountID,
        };
        return [fallbackIcon];
    }

@chiragxarora
Copy link
Contributor

chiragxarora commented Jul 9, 2023

Proposal

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

Incorrect tooltip on Invite members page

What is the root cause of that problem?

Root cause of the issue is the implementation of createOption() method in OptionsListUtils here

result.icons = ReportUtils.getIcons(report, personalDetails, UserUtils.getAvatar(personalDetail.avatar, personalDetail.accountID), false, personalDetail.login, personalDetail.accountID);

Here we are not checking the existence of report before creating the icons for current option using ReportUtils.getIcons()

if (report) {
result.isChatRoom = ReportUtils.isChatRoom(report);
result.isDefaultRoom = ReportUtils.isDefaultRoom(report);
result.isArchivedRoom = ReportUtils.isArchivedRoom(report);

and this util method is supposed to provide the icons from the report object passed to it, as mentioned here

App/src/libs/ReportUtils.js

Lines 796 to 797 in 60f4817

* Returns the appropriate icons for the given chat report using the stored personalDetails.
* The Avatar sources can be URLs or Icon components according to the chat type.

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

We should use the createIcons from util for the case where report exists, and when there is no report we should build the icons using accountID in the else part here

} else {
reportName = ReportUtils.getDisplayNameForParticipant(accountIDs[0]);

And for that, we have a helper utility function defined in the same OptionsListUtils called getAvatarsForAccountIDs() which returns the icons object using accountIDs

function getAvatarsForAccountIDs(accountIDs, personalDetails) {

Results
bandicam.2023-07-09.14-38-59-556.mp4

What alternative solutions did you explore? (Optional)

We can also use ReportUtils.getIconsForParticipants() which does the same task as OptionsListUtils.getAvatarsForAccountIDs() and additionally it sorts the list according to the firstname too which I think is not needed and will add extra complexity in our case. Also, this one in report util is intended for some other use case

@alexpensify
Copy link
Contributor

Not overdue, I was assigned when I was OOO

@alexpensify
Copy link
Contributor

I'm unable to replicate this experience on prod:

image

Now, in Staging this is an issue:

image

@alexpensify
Copy link
Contributor

@amyevans and @rushatgabhane - I think this is similar to #22062 (comment) but wanted to double check before closing. If it's a different root cause, then I'll assign External. Thank you for your feedback!

@situchan
Copy link
Contributor

It's a different root cause. This is a regression from #20512 but #22062 existed before.

@amyevans
Copy link
Contributor

It was added back in #22500 cc @grgia

@situchan
Copy link
Contributor

I confirmed fixed on latest main.
Once it's deployed to staging, we can retest and close this.

@alexpensify alexpensify changed the title DEV : Incorrect tooltip on Invite members page [HOLD App #22500] DEV : Incorrect tooltip on Invite members page Jul 12, 2023
@alexpensify alexpensify added Weekly KSv2 and removed Daily KSv2 labels Jul 12, 2023
@alexpensify
Copy link
Contributor

Thanks, I'm putting this one on Hold.

@situchan
Copy link
Contributor

#22500 was deployed to production.
This is not reproducible anymore. We can close this.
I might be eligible for reporting bonus.

@alexpensify
Copy link
Contributor

I've confirmed that this is not reproducible. There is no bonus because the fix was already in the works before this GH. @amyevans can I get a buddy check if you agree with my summary? Thank you!

@amyevans
Copy link
Contributor

@alexpensify I think paying the reporter bonus makes sense since this bug was reported in Slack about an hour before the revert PR was opened.

@alexpensify
Copy link
Contributor

@amyevans I should have asked my question differently. Did this GH help flag that we needed to revert? Thanks!

@amyevans
Copy link
Contributor

Oh honestly I don't know, I wasn't involved in that discovery. @0xmiroslav how did you uncover the bad merge conflict issue that led to #22500?

@0xmiros
Copy link
Contributor

0xmiros commented Jul 19, 2023

I discovered while random testing during another PR review.
The first discovery was another one - #21092 (review)
And this bug was discovered 2 days later - d64df72

@alexpensify
Copy link
Contributor

Ok, I've reviewed these points and feel like this GH didn't contribute to uncovering the regression. At this point, we should close but will leave it open until tomorrow if there are any remaining points to flag.

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. Needs Reproduction Reproducible steps needed Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants