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-28] [HOLD for payment 2024-06-24] [$250] Group chat thread - Inconsistency when leaving thread via 3-dot menu and group details page #43126

Closed
6 tasks done
lanitochka17 opened this issue Jun 5, 2024 · 24 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 Jun 5, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4-79-3
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 group chat.
  3. Send a message and send a reply in thread.
  4. Go to the thread.
  5. Leave the thread via 3-dot menu > Leave.
  6. Go to the same thread again.
  7. Note that when leaving thread via 3-dot menu, there is no "Heads up" warning and thread does not load when reopening the thread after leaving.
  8. Send a message and send a reply in thread.
  9. Go to the thread.
  10. Leave the thread via chat header > Leave.
  11. Go to the same thread again.
  12. Note that when leaving thread via group menu, there is "Heads up" warning and thread loads when reopening the thread after leaving.

Expected Result:

There should be consistency when leaving thread and reopening thread after leaving via 3-dot menu (Step 7) and group details page (Step 12)

Actual Result:

In Step 7. when leaving thread via 3-dot menu and reopening thread, there is no "Heads up" warning and thread does not load when reopening the thread after leaving
In Step 12, when leaving thread via group menu, there is "Heads up" warning and thread loads when reopening the thread after leaving

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

Bug6502481_1717577093194.bandicam_2024-06-05_16-39-37-515.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0166b95168c5d28cbd
  • Upwork Job ID: 1798387156425131546
  • Last Price Increase: 2024-06-05
  • Automatic offers:
    • akinwale | Reviewer | 102676476
    • bernhardoj | Contributor | 102676480
Issue OwnerCurrent Issue Owner: @puneetlath
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 5, 2024
Copy link

melvin-bot bot commented Jun 5, 2024

Triggered auto assignment to @puneetlath (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

@puneetlath 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

@dragnoir
Copy link
Contributor

dragnoir commented Jun 5, 2024

Proposal

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

Leave from 3 dots on the header is not the same as leave from the report details page

What is the root cause of that problem?

On HeaderView, for the 3 dots leave action we call for Report.leaveRoom

onSelected: Session.checkIfActionIsAllowed(() => Report.leaveRoom(reportID, isWorkspaceMemberLeavingWorkspaceRoom)),

But on ReportDetailsPage we call for Report.leaveGroupChat

Report.leaveGroupChat(report.reportID);

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

We should do the same on HeaderView, for the 3 dots.

We shoudl check if isChatRoom if so we call Report.leaveRoom, else we call for Report.leaveGroupChat

https://github.com/Expensify/App/blob/0efe60a7e681b02606b4e3d58bd000e3c88014cd/src/pages/ReportDetailsPage.tsx#L126-L131C9

onSelected: Session.checkIfActionIsAllowed(() => {
  if (isChatRoom) {
    Report.leaveRoom(report.reportID, isWorkspaceMemberLeavingWorkspaceRoom);
    return;
  }
   Report.leaveGroupChat(report.reportID);
  }),

What alternative solutions did you explore?

@ShridharGoel
Copy link
Contributor

This is not a bug, confirmation modal is only needed when last member leaves the group chat and not a thread.

@bernhardoj
Copy link
Contributor

Proposal

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

Pressing leave from the report detail page shows a modal confirmation but not from the 3-dot menu.

What is the root cause of that problem?

It's expected that if we press Leave from a 3-dot, it won't show a confirmation modal. It's only for a group chat in detail page as you can see here.

if (ReportUtils.getParticipantAccountIDs(report.reportID, true).length === 1 && isGroupChat) {
setIsLastMemberLeavingGroupModalVisible(true);

The real problem here is that, the leave button on the detail page shouldn't show for a thread. The condition to show the leave button is if it's either a group chat or a chat room and canLeaveChat is true.

if (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy ?? null))) {

When we create a thread inside a group chat, it's still detected as a group chat because thread chatType is inherited from its parent.

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

Don't show the leave button option if it's a thread.

if (!isThread && (isGroupChat || (isChatRoom && ReportUtils.canLeaveChat(report, policy ?? null)))) {

We did this before in the original PR, but treated as out of scope.

@ShridharGoel
Copy link
Contributor

Proposal

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

Group chat thread - Inconsistency when leaving thread via 3-dot menu and group details page.

What is the root cause of that problem?

This is not a bug, confirmation modal is only needed when last member leaves the group chat and not a thread.

I think join and leave options are needed in threads to set notification preferences. But if we want to avoid showing them, then that can be done.

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

In canJoinChat, instead of isRootGroupChat we can use isGroupChat at this place:

// Anyone viewing these chat types is already a participant and therefore cannot join
if (isGroupChat(report) || isSelfDM(report) || isInvoiceRoom(report) || isSystemChat(report)) {
    return false;
}

In canLeaveChat, again instead of isRootGroupChat we can use isGroupChat at this place:

// Anyone viewing these chat types is already a participant and therefore cannot leave
if (isSelfDM(report) || isGroupChat(report)) {
    return false;
}

@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Jun 5, 2024
Copy link

melvin-bot bot commented Jun 5, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0166b95168c5d28cbd

@melvin-bot melvin-bot bot changed the title Group chat thread - Inconsistency when leaving thread via 3-dot menu and group details page [$250] Group chat thread - Inconsistency when leaving thread via 3-dot menu and group details page Jun 5, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 5, 2024
Copy link

melvin-bot bot commented Jun 5, 2024

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

@akinwale
Copy link
Contributor

akinwale commented Jun 8, 2024

We can move forward with @bernhardoj's proposal here since it's the best approach to solving the issue.

🎀👀🎀 C+ reviewed.

Copy link

melvin-bot bot commented Jun 8, 2024

Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@ShridharGoel
Copy link
Contributor

ShridharGoel commented Jun 8, 2024 via email

@melvin-bot melvin-bot bot added Overdue and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Jun 10, 2024
Copy link

melvin-bot bot commented Jun 10, 2024

📣 @akinwale 🎉 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 Jun 10, 2024

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

@bernhardoj
Copy link
Contributor

PR is ready

cc: @akinwale

@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 17, 2024
@melvin-bot melvin-bot bot changed the title [$250] Group chat thread - Inconsistency when leaving thread via 3-dot menu and group details page [HOLD for payment 2024-06-24] [$250] Group chat thread - Inconsistency when leaving thread via 3-dot menu and group details page Jun 17, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 17, 2024
Copy link

melvin-bot bot commented Jun 17, 2024

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

Copy link

melvin-bot bot commented Jun 17, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.84-3 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-24. 🎊

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

Copy link

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

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 21, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-24] [$250] Group chat thread - Inconsistency when leaving thread via 3-dot menu and group details page [HOLD for payment 2024-06-28] [HOLD for payment 2024-06-24] [$250] Group chat thread - Inconsistency when leaving thread via 3-dot menu and group details page Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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

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

Copy link

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

  • [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
  • [@akinwale] 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] 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] Determine if we should create a regression test for this bug.
  • [@akinwale] 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.
  • [@puneetlath] 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 and removed Weekly KSv2 labels Jun 24, 2024
@puneetlath
Copy link
Contributor

@akinwale bump on the checklist so we can pay.

@akinwale
Copy link
Contributor

  • [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
  • [@akinwale] 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] 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:'

Not a regression.

  • [@akinwale] Determine if we should create a regression test for this bug.
  • [@akinwale] 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.

Regression Test Steps

  1. Launch the Expensify app.
  2. Create a group chat or open an existing group chat.
  3. Send a message.
  4. Reply in the thread of the new message.
  5. Click or tap on the thread header.
  6. Verify that there is no leave button on the details page.

Do we agree 👍 or 👎?

@akinwale
Copy link
Contributor

@puneetlath Done.

@melvin-bot melvin-bot bot added the Overdue label Jun 27, 2024
@puneetlath
Copy link
Contributor

Regression issue here:

All paid. Thanks y'all!

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

6 participants