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

[$500] Web - The group is deleted when there are no messages or the first parent message deleted #27295

Closed
1 of 6 tasks
kbecciv opened this issue Sep 12, 2023 · 15 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Sep 12, 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. Create a group
  2. Send any message
  3. Hover on message and reply in thread
  4. Send any message on thread
  5. Delete the parent message, Observed that the chat group disappeared on LHN

Expected Result:

Group chat remains on LHN when there are no messages or messages are deleted.

Actual Result:

Group chat disappeared on LHN

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.68.13
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

Screen.Recording.2023-09-10.at.11.19.40.1.mov
Recording.4423.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ad723399ebef5bd6
  • Upwork Job ID: 1701697394182508544
  • Last Price Increase: 2023-09-19
@kbecciv kbecciv 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 Sep 12, 2023
@melvin-bot melvin-bot bot changed the title Web - The group is deleted when there are no messages or the first parent message deleted [$500] Web - The group is deleted when there are no messages or the first parent message deleted Sep 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

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

melvin-bot bot commented Sep 12, 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
Copy link

melvin-bot bot commented Sep 12, 2023

Triggered auto assignment to @zanyrenney (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@kbecciv
Copy link
Author

kbecciv commented Sep 12, 2023

Proposal by: @namhihi237
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694319570718779

Proposal

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

What is the root cause of that problem?

We are checking whether the report is displayed on LHN here:

App/src/libs/ReportUtils.js

Lines 2847 to 2850 in 6188d7b

// Hide chats between two users that haven't been commented on from the LNH
if (excludeEmptyChats && isEmptyChat && isChatReport(report) && !isChatRoom(report) && !isPolicyExpenseChat(report)) {
return false;
}

We are checking the isEmptyChat report here

App/src/libs/ReportUtils.js

Lines 2818 to 2820 in 6188d7b

const lastVisibleMessage = ReportActionsUtils.getLastVisibleMessage(report.reportID);
const isEmptyChat = !lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey;

Here, if the report has only 1 message and that message has a thread. After deleting the parent message, the report still displays the message [Deleted message] and there is a thread in this message. But we are only checking lastVisibleMessage so the miss case message is deleted but the thread remains.

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

We should update the isEmptyChat checking logic by checking reportActions. If there is any item with childVisibleActionCount > 0. That means the message still has a thread.

    const lastVisibleMessage = ReportActionsUtils.getLastVisibleMessage(report.reportID);
    const reportActions = ReportActionsUtils.getAllReportActions(report.reportID);
    let isEmptyChat = false;
    if (!lastVisibleMessage.lastMessageText && !lastVisibleMessage.lastMessageTranslationKey) {
        const has thread = _.some(reportActions, (reportAction) => reportAction.childCommenterCount > 0);
        isEmptyChat = !hasThread
    }

Result:
https://github.com/Expensify/App/assets/39086067/ddf7244d-16ad-4bf2-bf3d-3b170de3aa8e

What alternative solutions did you explore? (Optional)

N/A

@dukenv0307
Copy link
Contributor

The same root cause with #26791.

@DylanDylann
Copy link
Contributor

Maybe relate to #19722

@Ollyws
Copy link
Contributor

Ollyws commented Sep 14, 2023

Will #27410 fix this issue then @dukenv0307?

@dukenv0307
Copy link
Contributor

Yes.

@CortneyOfstad
Copy link
Contributor

@zanyrenney There is known issue (more info here) where it is double-assigning, so removing your assignment 👍

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

@CortneyOfstad
Copy link
Contributor

@Ollyws since this will be corrected under the other PR, we're free to close this then — correct?

@melvin-bot melvin-bot bot removed the Overdue label Sep 18, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Sep 18, 2023

Yeah we're good to close it.

@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

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

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

6 participants