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-22] [$500] Group chat - Room name in settings is different than the name in chat report and LHN title #30257

Closed
6 tasks done
lanitochka17 opened this issue Oct 24, 2023 · 27 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 24, 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!


Version Number: 1.3.90-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
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:

Issue found when executing PR #28991

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a group chat with at least four members
  3. Click on the chat header
  4. Go to Settings
    Note that the room name is different from the name in LHN and chat header

Expected Result:

The room name is consistent with the name in the group chat header and report title in LHN

Actual Result:

The room name is different from the name in the group chat header and report title in LHN

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

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Bug6248862_1698155671967.bandicam_2023-10-24_21-07-02-672.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010327954e256575ce
  • Upwork Job ID: 1716822959251263488
  • Last Price Increase: 2023-10-24
  • Automatic offers:
    • DylanDylann | Contributor | 27544084
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 24, 2023
@melvin-bot melvin-bot bot changed the title Group chat - Room name in settings is different than the name in chat report and LHN title [$500] Group chat - Room name in settings is different than the name in chat report and LHN title Oct 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

Job added to Upwork: https://www.upwork.com/jobs/~010327954e256575ce

@melvin-bot
Copy link

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

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

melvin-bot bot commented Oct 24, 2023

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

@esh-g
Copy link
Contributor

esh-g commented Oct 24, 2023

I think the room name is set the backend and the sorting should take place there like it does in ReportUtils.getDisplayNamesWithTooltips

@akamefi202
Copy link
Contributor

akamefi202 commented Oct 24, 2023

Proposal

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

Room name in settings is different than the name in chat report and LHN title.

What is the root cause of that problem?

return _.map(participantsWithoutCurrentUser, (accountID) => getDisplayNameForParticipant(accountID, isMultipleParticipantReport)).join(', ');

Room name in settings gets the value from getReportName function without sorting.

App/src/libs/ReportUtils.js

Lines 1231 to 1236 in 485a851

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

But other room names get the value from getDisplayNamesWithTooltips function with sorting.
Sorting makes difference.

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

We can add sorting of getDisplayNamesWithTooltips function in getReportName function to fix difference.

What alternative solutions did you explore? (Optional)

N/A

@syedsaroshfarrukhdot
Copy link
Contributor

Proposal

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

Room name in settings is different than the name in chat report and LHN title.

What is the root cause of that problem?

Room Name in getReportName Function is not returning sorted list.

return _.map(participantsWithoutCurrentUser, (accountID) => getDisplayNameForParticipant(accountID, isMultipleParticipantReport)).join(', ');

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

We need to return sortedParticipants by sorting Participants in same way they are being sorted in getDisplayNamesWithTooltips

       const sortedParticipants = _.chain(participantsWithoutCurrentUser)
             .map((accountID) => getDisplayNameForParticipant(accountID, isMultipleParticipantReport))
             .sort((first, second) => first.localeCompare(second))
             .value();

       return sortedParticipants.join(', ');

What alternative solutions did you explore? (Optional)

N/A

@DylanDylann
Copy link
Contributor

DylanDylann commented Oct 26, 2023

Proposal

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

  • Group chat - Room name in settings is different than the name in chat report and LHN title

What is the root cause of that problem?

  • The ways we get the room nane in settings is different than the way we did in LHNRow and Report `s header.
  • Here is how we get the room name in settings:
    const reportName = ReportUtils.getReportName(props.report);
  • Here is how we did with Report `s header and same with LHNRow:
    const title = ReportUtils.isGroupChat(props.report) ? ReportUtils.getDisplayNamesStringFromTooltips(displayNamesWithTooltips) : ReportUtils.getReportName(reportHeaderData);

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

  • We should create the util function like ````getGroupChatName``` that based on what we did with LHNRow and Report `s header and use in these above cases like:
const getGroupChatName = (report) => {
    const participants = lodashGet(report, 'participantAccountIDs', []);
    const isMultipleParticipantReport = participants.length > 1;
    const participantPersonalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(participants, allPersonalDetails);
    const displayNamesWithTooltips = getDisplayNamesWithTooltips(participantPersonalDetails, isMultipleParticipantReport);
    return getDisplayNamesStringFromTooltips(displayNamesWithTooltips);
};
const reportName = ReportUtils.isGroupChat(props.report)? ReportUtils.getGroupChatName(props.report) : ReportUtils.getReportName(props.report);
  • Do the same with LHNRow and Report `s header.

What alternative solutions did you explore? (Optional)

  • NA

@melvin-bot melvin-bot bot added the Overdue label Oct 26, 2023
@burczu
Copy link
Contributor

burczu commented Oct 27, 2023

not overdue - I'll review proposals soon

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

@burczu, @anmurali Whoops! This issue is 2 days overdue. Let's get this updated quick!

@burczu
Copy link
Contributor

burczu commented Oct 31, 2023

I've reviewed all the proposals and I think all contributors identified the root cause correctly.

I like the most the proposal from @DylanDylann because I believe we should not change the implementation of the getReportName function itself as it's used in many places in the app, and sorting may not be expected in other places.

🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Oct 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 31, 2023

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

@akamefi202
Copy link
Contributor

akamefi202 commented Oct 31, 2023

@burczu Thank you for your review. But I think that we don't need to add a new function for this.

App/src/libs/ReportUtils.js

Lines 4099 to 4109 in f8e77de

function isGroupChat(report) {
return (
report &&
!isChatThread(report) &&
!isTaskReport(report) &&
!isMoneyRequestReport(report) &&
!isArchivedRoom(report) &&
!Object.values(CONST.REPORT.CHAT_TYPE).includes(getChatType(report)) &&
lodashGet(report, 'participantAccountIDs.length', 0) > 2
);
}

This is how isGroupChat function works and it is calling other functions such as isChatThread, isTaskReport, etc.
And similar logic already exists inside getReportName function.

App/src/libs/ReportUtils.js

Lines 2045 to 2054 in f8e77de

if (formattedName) {
return formattedName;
}
// Not a room or PolicyExpenseChat, generate title from participants
const participantAccountIDs = (report && report.participantAccountIDs) || [];
const participantsWithoutCurrentUser = _.without(participantAccountIDs, currentUserAccountID);
const isMultipleParticipantReport = participantsWithoutCurrentUser.length > 1;
return _.map(participantsWithoutCurrentUser, (accountID) => getDisplayNameForParticipant(accountID, isMultipleParticipantReport)).join(', ');

getReportName function is also calling functions such as isChatThread, isTaskReport, etc for categorization.
And it will return formattedName if the report is not group chat.

So the code part that I suggested to add sorting will not be called unless the report is group chat.
That's why I think that we don't need to add a separate function for group chat.
Thank you for consideration and please share you thoughts.

@DylanDylann
Copy link
Contributor

DylanDylann commented Oct 31, 2023

@akamefi202 My proposal wraps all the logic we used to get the Report header and LHN Row to a single util function and used in Room name as well for consistency and reducing duplicate logic. Also, the logic we used in Report header and LHN Row are tested over the time without any bug

@burczu
Copy link
Contributor

burczu commented Oct 31, 2023

@anmurali Just to inform, I'll be ooo for the next few days and we'll be back on Monday, November 6th.

@DylanDylann
Copy link
Contributor

@Li357 pleae help review the proposals as C+ `ve reviewed

@melvin-bot melvin-bot bot added the Overdue label Nov 2, 2023
Copy link

melvin-bot bot commented Nov 3, 2023

@burczu, @Li357, @anmurali Whoops! This issue is 2 days overdue. Let's get this updated quick!

@Li357
Copy link
Contributor

Li357 commented Nov 6, 2023

Agree with deduplicating logic here. @DylanDylann all yours

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

melvin-bot bot commented Nov 6, 2023

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

Copy link

melvin-bot bot commented Nov 7, 2023

@burczu @Li357 @anmurali @DylanDylann this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 8, 2023
@DylanDylann
Copy link
Contributor

@burczu PR #31016 is ready for review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 15, 2023
@melvin-bot melvin-bot bot changed the title [$500] Group chat - Room name in settings is different than the name in chat report and LHN title [HOLD for payment 2023-11-22] [$500] Group chat - Room name in settings is different than the name in chat report and LHN title Nov 15, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 15, 2023
Copy link

melvin-bot bot commented Nov 15, 2023

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

Copy link

melvin-bot bot commented Nov 15, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.99-0 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-22. 🎊

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:

Copy link

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

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

@burczu
Copy link
Contributor

burczu commented Nov 21, 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:

  • [@burczu] The PR that introduced the bug has been identified. Link to the PR:

I don't think this issue is an regression caused by another PR - room name settings, chat report name and LHN title was developed separately and this discrepancy was just missed.

  • [@burczu] 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:

n/a

  • [@burczu] 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:

n/a

  • [@burczu] Determine if we should create a regression test for this bug.

I think this is not very impactul issue, and isn't related to any super important flow, so I tend to believe that we don't need to add regression tests here. Also, in the PR fixing this issue, we extracted providing the group chat name to the separate method and now using it in all the affected places, so I think this not very likely this issue will occur again.

  • [@burczu] 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.
  • [@anmurali] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Nov 22, 2023
Copy link

melvin-bot bot commented Nov 27, 2023

@burczu, @Li357, @anmurali, @DylanDylann Huh... This is 4 days overdue. Who can take care of this?

@anmurali
Copy link

Paid!

@melvin-bot melvin-bot bot removed the Overdue label Nov 29, 2023
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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants