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 2024-06-11] [$250] Group chat - Group chat when left with only group creator shows up in Start chat list #41140

Closed
6 tasks done
lanitochka17 opened this issue Apr 27, 2024 · 46 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 Apr 27, 2024

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.4.67-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: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Start chat
  3. Create a group chat
  4. Send a message to the group chat
  5. Go to chat header > Members
  6. Remove all the members
  7. Go to FAB > Start chat

Expected Result:

The group chat which is now left with only group creator will not show up in Start chat list

Actual Result:

The group chat which is now left with only group creator shows up in Start chat list and it can be added to group. As a result, the confirmation page shows two same admin

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

Add any screenshot/video evidence

Bug6463603_1714209122767.20240427_170819.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fc4346325c33c31c
  • Upwork Job ID: 1785340853833224192
  • Last Price Increase: 2024-05-14
  • Automatic offers:
    • hoangzinh | Reviewer | 0
    • gijoe0295 | Contributor | 0
Issue OwnerCurrent Issue Owner: @bfitzexpensify
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 27, 2024
Copy link

melvin-bot bot commented Apr 27, 2024

Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@bfitzexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@gijoe0295
Copy link
Contributor

gijoe0295 commented Apr 27, 2024

Proposal

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

Group chat with 1 member shows in Recents section when creating new chat.

What is the root cause of that problem?

Even though we don't want to includeMultipleParticipantReports, the group chat with 1 member is not considered to be a multiple participants report:

hasMultipleParticipants = personalDetailList.length > 1 || result.isChatRoom || result.isPolicyExpenseChat;

so the option's login is the group owner:

result.login = personalDetail?.login;

and eventually fail this check:

if (!isCurrentUserOwnedPolicyExpenseChatThatCouldShow && !includeMultipleParticipantReports && !reportOption.login) {

If you tried to press the group chat option (create chat), it would lead to the group chat owner's report and cause Auth error.

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

Add isGroupChat condition to hasMultipleParticipants check above just like we did with other similar types.

hasMultipleParticipants = personalDetailList.length > 1 || result.isChatRoom || result.isPolicyExpenseChat;

By this, we would hide the group chat from start chat page even though it has only 1 participant.

What alternative solutions did you explore? (Optional)

NA

@dragnoir
Copy link
Contributor

Proposal

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

Taxes - Buttons on the top not filing the space evenly

What is the root cause of that problem?

inside OptionsListUtils when the function getOptions is creating the recent reports,
We have this condition that filter out some reports

if (!isCurrentUserOwnedPolicyExpenseChatThatCouldShow && !includeMultipleParticipantReports && !reportOption.login) {

It's not working in our case because a group chat with one user has reportOption.login defined

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

Beside the checks here

if (!isCurrentUserOwnedPolicyExpenseChatThatCouldShow && !includeMultipleParticipantReports && !reportOption.login) {
continue;
}

We need also to add another check

const isSingleUserGroupChat = isGroupChat && !hasMultipleParticipants

so the code will be

if (
    !isCurrentUserOwnedPolicyExpenseChatThatCouldShow 
    && !includeMultipleParticipantReports 
    && !reportOption.login
    && isSingleUserGroupChat ) {
      continue;
}

@melvin-bot melvin-bot bot added the Overdue label Apr 29, 2024
@bfitzexpensify bfitzexpensify added the External Added to denote the issue can be worked on by a contributor label Apr 30, 2024
@melvin-bot melvin-bot bot changed the title Group chat - Group chat when left with only group creator shows up in Start chat list [$250] Group chat - Group chat when left with only group creator shows up in Start chat list Apr 30, 2024
Copy link

melvin-bot bot commented Apr 30, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 30, 2024
Copy link

melvin-bot bot commented Apr 30, 2024

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

@tsa321
Copy link
Contributor

tsa321 commented May 1, 2024

Proposal

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

Removed member of group chat with remaining one member listed in start chat option list

What is the root cause of that problem?

In here:

// Skip if we aren't including multiple participant reports and this report has multiple participants
if (!isCurrentUserOwnedPolicyExpenseChatThatCouldShow && !includeMultipleParticipantReports && !reportOption.login) {
continue;
}

In the comment, the code is intended to filters multiple participant chat, but the code filters expense/policy chat and we don't add proper filter for multiple participant / group chat yet.

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

we could add check below that code to filter multiple participant chat / group chat, the code could be:

if (!includeMultipleParticipantReports && ((reportOption.participantsList.length > 1) || ReportUtils.isGroupChat(reportOption))) {
      continue;
}

Or we could add includeGroupChatReport parameter in getOptions function :

function getOptions(

then add check properly using ReportUtils.isGroupChat

@hoangzinh
Copy link
Contributor

@gijoe0295 @dragnoir @tsa321 Thanks for your proposal, everyone. Could you check again if your solution works? Because when I apply all of your solutions, the group chat disappears but it shows the "self DM" chat of current login user.

Screen.Recording.2024-05-02.at.22.39.42.mov

@dragnoir
Copy link
Contributor

dragnoir commented May 2, 2024

@hoangzinh here's a quick draft dragnoir@8fc9ef9

code can be enhanced throw PR, just sharing the idea.

@hoangzinh
Copy link
Contributor

It still shows self-DM in the list.

Screenshot 2024-05-02 at 23 55 54

@dragnoir
Copy link
Contributor

dragnoir commented May 2, 2024

@hoangzinh the issue is not about self DM

Expected Result:
The group chat which is now left with only group creator will not show up in Start chat list

and if you try the production, chat with YOU, then it's on the recent contacts on new chat

@gijoe0295
Copy link
Contributor

gijoe0295 commented May 2, 2024

@hoangzinh Could you try to send new messages to several DMs in order to push the self-DM away from the Recents list and retry my solution? I think it might be because the self-DM is still the within recent chat list. I couldn't reproduce the issue on my end.

Screen.Recording.2024-05-03.at.00.30.38-source.mov

@tsa321
Copy link
Contributor

tsa321 commented May 2, 2024

@hoangzinh the self DM is also appear in staging and production. Is the expected result to exclude self-DM from recent list? We can filter the self DM if it is expected result...

@hoangzinh
Copy link
Contributor

Thanks everyone for actively discussing this issue. Somehow I couldn't reproduce the behavior here #41140 (comment) so let's leave it there

@hoangzinh
Copy link
Contributor

hoangzinh commented May 3, 2024

Screen.Recording.2024-05-03.at.22.43.25.mov
  • @tsa321 Thanks for your proposal, IMO you proposed a solution that works well but I don't think you have the correct RCA. Therefore, your solution does not fix the root cause.

@hoangzinh
Copy link
Contributor

@gijoe0295 Thanks for your proposal. Your proposal has the correct RCA and it provides a solution that fixes the root cause. Therefore it looks good to me.

Link to proposal #41140 (comment)

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented May 3, 2024

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

@dragnoir
Copy link
Contributor

dragnoir commented May 3, 2024

@hoangzinh the selected proposal will cause regressions like hiding those details

if (!hasMultipleParticipants) {
result.login = personalDetail?.login;
result.accountID = Number(personalDetail?.accountID);
result.phoneNumber = personalDetail?.phoneNumber;
}

then you can't search for a user with the email!!! and other regressions

Copy link

melvin-bot bot commented May 14, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@gijoe0295
Copy link
Contributor

This is awaiting input from @roryabraham.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label May 15, 2024
Copy link

melvin-bot bot commented May 15, 2024

📣 @hoangzinh 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented May 15, 2024

📣 @gijoe0295 🎉 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 Overdue and removed Overdue labels May 15, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Overdue labels May 18, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 4, 2024
@melvin-bot melvin-bot bot changed the title [$250] Group chat - Group chat when left with only group creator shows up in Start chat list [HOLD for payment 2024-06-11] [$250] Group chat - Group chat when left with only group creator shows up in Start chat list Jun 4, 2024
Copy link

melvin-bot bot commented Jun 4, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 4, 2024
Copy link

melvin-bot bot commented Jun 4, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.78-5 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 2024-06-11. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jun 4, 2024

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:

  • [@hoangzinh] The PR that introduced the bug has been identified. Link to the PR:
  • [@hoangzinh] 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:
  • [@hoangzinh] 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:
  • [@hoangzinh] Determine if we should create a regression test for this bug.
  • [@hoangzinh] 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.
  • [@bfitzexpensify] 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 Jun 10, 2024
@roryabraham
Copy link
Contributor

This is ready to pay tomorrow

@hoangzinh
Copy link
Contributor

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: I think it's a new edge case that we haven't covered yet. Therefore, I think we don't have any offending PR here.
  • 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
  • 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
  • Determine if we should create a regression test for this bug: ✅ Yes we should

@hoangzinh
Copy link
Contributor

Regression Test Proposal

  1. Sign in to any account
  2. Go to FAB > Start chat
  3. Create a group chat
  4. Send a message to the group chat
  5. Go to chat header > Members
  6. Remove all the members
  7. Go to FAB > Start chat
  8. Verify that the group chat which is now left with only group creator will not show up in the chat list

Do we agree 👍 or 👎

@bfitzexpensify
Copy link
Contributor

LGTM. Steps proposed in https://github.com/Expensify/Expensify/issues/403933.

Payments complete. Thanks everyone

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
No open projects
Archived in project
Development

No branches or pull requests

7 participants