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 for payment 2023-11-01] [HOLD for payment 2023-10-13] [$500] Web - The order of avatars on the header sometimes matches the avatars on chat view #28048

Closed
1 of 6 tasks
kbecciv opened this issue Sep 22, 2023 · 44 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Sep 22, 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!


Issue found when executing PR #25416

Action Performed:

Precondition: Logged into new dot.

  1. Create a group chat.
  2. Observe the order of avatars on the header and the order of avatars on the chat view.

Expected Result:

The order should match.

Actual Result:

The order sometimes matches or doesn't match.

Workaround:

Unknown

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: 1.3.73.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
Notes/Photos/Videos: Any additional supporting documentation

Bug6210843_The_order_of_avatars_on_the_header_sometimes_matches_the_avatars_on_chat_view.mp4

Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e20b778de4f7c770
  • Upwork Job ID: 1706233303056359424
  • Last Price Increase: 2023-09-25
  • Automatic offers:
    • akinwale | Contributor | 26875267
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

@melvin-bot
Copy link

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

@akinwale
Copy link
Contributor

akinwale commented Sep 23, 2023

Proposal

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

In a group chat, the order of participants in the header is not sorted the same way as the avatars in the chat view.

What is the root cause of that problem?

In ReportUtils, the getDisplayNamesWithTooltips implementation which is used to get the list of names in the HeaderView does not apply any sorting to the display names returned. getIconsForParticipants which is the method used for obtaining the list of avatars in the chat view, however does apply a sort to the list of avatars returned.

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

Apply the same logic for sorting used in getIconsForParticipants to getDisplayNamesWithTooltips. Also (optionally) add a flag parameter, shouldSort to getDisplayNamesWithTooltips which indicates whether or not the returned list should be sorted. If the shouldSort parameter is not used, then the returned list of display names will always be sorted in every instance where the getDisplayNamesWithTooltips method is called.

function getDisplayNamesWithTooltips(personalDetailsList, isMultipleParticipantReport, shouldSort) {
    const displayNames = _.map(personalDetailsList, (user) => {
        ...
    });

    if (!shouldSort) {
        return displayNames;
    }
    
    const sortedDisplayNames = _.chain(displayNames)
        .sort((first, second) => {
            // First sort by displayName/login
            const displayNameLoginOrder = first.displayName.localeCompare(second.displayName);
            if (displayNameLoginOrder !== 0) {
                return displayNameLoginOrder;
            }

            // Then fallback on accountID as the final sorting criteria.
            return first.accountID > second.accountID;
        })
        .value();
    return sortedDisplayNames;
}

If we do add the shouldSort parameter, HeaderView also needs to be updated.

-const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(participantPersonalDetails, isMultipleParticipant);
+const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(participantPersonalDetails, isMultipleParticipant, true);

What alternative solutions did you explore? (Optional)

None.

@mountiny
Copy link
Contributor

cc @cead22 @mananjadhav @honnamkuan seems like this was found coming from your PR, potential regression

@akinwale
Copy link
Contributor

@mountiny It looks like the names in the header were not being sorted prior, and based on the issue history at #23364, the selected proposal is fixing an existing sorting implementation, so it's safe to assume that it's probably not a regression since the names in the header were never a consideration in the first place.

@cead22
Copy link
Contributor

cead22 commented Sep 25, 2023

Apply the same logic for sorting used in getIconsForParticipants to getDisplayNamesWithTooltips

👍 . I don't think we need the optional parameter, in fact, I imagine we don't want the optional parameter since that will allow us to sort things differently, right?

@mountiny
Copy link
Contributor

Thanks for confirming, I have admitedly not gone through the linked issue, just coming off the QA linking it at the header.

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Sep 25, 2023
@melvin-bot melvin-bot bot changed the title Web - The order of avatars on the header sometimes matches the avatars on chat view [$500] Web - The order of avatars on the header sometimes matches the avatars on chat view Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

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

melvin-bot bot commented Sep 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@akinwale
Copy link
Contributor

akinwale commented Sep 25, 2023

Apply the same logic for sorting used in getIconsForParticipants to getDisplayNamesWithTooltips

👍 . I don't think we need the optional parameter, in fact, I imagine we don't want the optional parameter since that will allow us to sort things differently, right?

Well, I was assuming since getDisplayNamesWithTooltips is also used in the LHN, performance might take a hit having to sort for all open reports, especially for users with a lot of reports. I have not specifically measured this, however.

EDIT: I see each display name list is limited to a max of 10 participants in the LHN, so maybe it wouldn't necessarily be a significant hit.

@allroundexperts
Copy link
Contributor

@akinwale's proposal makes sense. Let's go with that.

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Sep 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

📣 @allroundexperts Please request via NewDot manual requests for the Reviewer role ($500)

@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

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

@melvin-bot melvin-bot bot added the Weekly KSv2 label Oct 6, 2023
@akinwale
Copy link
Contributor

akinwale commented Oct 6, 2023

@stitesExpensify I've created a follow-up PR. I would like to get some more eyes on the isGroupChat method for additional insight, if possible. Thanks.

cc @allroundexperts

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

@akinwale, @miljakljajic, @allroundexperts, @stitesExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

@miljakljajic
Copy link
Contributor

What are the next steps for this one?

@akinwale
Copy link
Contributor

What are the next steps for this one?

Currently waiting for feedback on the second PR.

@miljakljajic
Copy link
Contributor

@allroundexperts can you review when you have a chance?

@allroundexperts
Copy link
Contributor

@miljakljajic

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @akinwale got assigned: 2023-09-26 02:48:24 Z
  • when the PR got merged: 2023-10-23 18:18:19 UTC
  • days elapsed: 19

On to the next one 🚀

@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

⚠️ 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.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 Weekly KSv2 labels Oct 24, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-10-13] [$500] Web - The order of avatars on the header sometimes matches the avatars on chat view [HOLD for payment 2023-11-01] [HOLD for payment 2023-10-13] [$500] Web - The order of avatars on the header sometimes matches the avatars on chat view Oct 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.90-2 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-11-01. 🎊

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:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 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:

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

@miljakljajic
Copy link
Contributor

@akinwale offer sent!

@akinwale
Copy link
Contributor

akinwale commented Nov 2, 2023

@akinwale offer sent!

Accepted. Thanks!

@miljakljajic
Copy link
Contributor

Paid! Closing.

@tienifr
Copy link
Contributor

tienifr commented Nov 2, 2023

As having reported the regression previously here, I'm grateful to be compensated for bug reporting.

@allroundexperts
Copy link
Contributor

@miljakljajic I was assigned as a C+ here. Can you please write a payment summary for me as well?

@miljakljajic
Copy link
Contributor

@allroundexperts I skipped you for payment based on this comment:

@allroundexperts does not require payment (Eligible for Manual Requests)

Is that a mistake?

@allroundexperts
Copy link
Contributor

@miljakljajic In order to approve the manual request, the internal member must see the payment summary in the issue.

@miljakljajic
Copy link
Contributor

Ah @allroundexperts I totally misunderstood that message. Thank you and sorry!

Payment Summary:

@allroundexperts eligible for $500 based on their work as the C+ reviewing the PR.

@allroundexperts
Copy link
Contributor

allroundexperts commented Nov 2, 2023

No worries. This one had a regression so the amount should be 50% for me and @akinwale.

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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants