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

Web - LHN shows a message that has been flagged as Intimidation or Bullying as an "alternateText" #23570

Closed
6 tasks
kbecciv opened this issue Jul 25, 2023 · 6 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jul 25, 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!


Action Performed:

  1. Send a message from account A to account B
  2. From account B report the message as Intimidation or Bullying
  3. Notice in the LHN the reported hidden message still shows as alternateText

Expected Result:

Like messages reported as Harrasment/Assault, messages flagged as Intimidation or Bullying should not be shown in LHN "alternateText" section

Actual Result:

The flagged message still shows as an alternateText in 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.44-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

Screen.Recording.2023-07-24.at.3.15.06.PM.mov
Recording.3898.mp4

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

View all open jobs on GitHub

@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

@melvin-bot
Copy link

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

@kbecciv
Copy link
Author

kbecciv commented Jul 25, 2023

Proposal: @AmjedNazzal
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690212523695399

Proposal

AmjedNazzal on GH

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

LHN shows a message that has been flagged as Intimidation or Bullying as an "alternateText"

What is the root cause of that problem?

The issue is that OptionsListUtils.getLastMessageTextForReport is only accounting for the case where MODERATOR_DECISION is PENDING_REMOVE and not PENDING_HIDE and so when a message is hidden but not deleted we still push it through to the LHN as "alternateText";

if (ReportActionUtils.isPendingRemove(lastNonWhisper)) {
const latestVisibleAction =
_.find(
allSortedReportActions[report.reportID],
(action) => ReportActionUtils.shouldReportActionBeVisible(action, action.reportActionID) && !ReportActionUtils.isWhisperAction(action),
) || {};
lastMessageTextFromReport = lodashGet(latestVisibleAction, 'message[0].text', '');

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

We first need to make isPendingHide function in ReportActionUtils

function isPendingHide(reportAction) {
    return lodashGet(reportAction, 'message[0].moderationDecisions[0].decision') === CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE;
}

We then can change OptionsListUtils.getLastMessageTextForReport to account for pending hide messages

if (ReportActionUtils.isPendingRemove(lastNonWhisper) || ReportActionUtils.isPendingHide(lastNonWhisper)) {
    const latestVisibleAction =
        _.find(
            allSortedReportActions[report.reportID],
            (action) => ReportActionUtils.shouldReportActionBeVisible(action, action.reportActionID) && !ReportActionUtils.isWhisperAction(action) && !ReportActionUtils.isPendingHide(action),
        ) || {};
    lastMessageTextFromReport = lodashGet(latestVisibleAction, 'message[0].text', '');
}

We also need to account for the return of "_fake_" in SideBarUtils in case the hidden message is in a thread where no other message is before it, this way it would return "No Activity Yet".

result.alternateText = lastMessageTextFromReport.length > 0 && lastMessageTextFromReport !== '__fake__' ? lastMessageText : Localize.translate(preferredLocale, 'report.noActivityYet');

What alternative solutions did you explore? (Optional)

Result

Screen.Recording.2023-07-24.at.5.49.31.PM.mov

Kateryna Becciv
2 minutes ago
Reproduced
Recording #3898.mp4

Reply…
Also send to expensify-bugs

@melvin-bot melvin-bot bot added the Overdue label Jul 27, 2023
@sonialiap
Copy link
Contributor

Reproducible

Hmm looks like we should have fixed this in this issue #21497, right @greg-schroeder ?

@melvin-bot melvin-bot bot removed the Overdue label Jul 28, 2023
@sonialiap
Copy link
Contributor

Dupe of #21890

@parasharrajat
Copy link
Member

parasharrajat commented Jul 28, 2023

I think it is separate from #21890. The author reported both of these separately. They could have been combined together being closely related.

Solution of #21890 does not overlap with this issue. @sonialiap

Edit:

As the solution is very much different for both issues. It's fine for both to be two different bugs.

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
Projects
None yet
Development

No branches or pull requests

3 participants