Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.35k stars 2.78k forks source link

[HOLD for payment 2024-09-18] [Search v2.2] Deleted message changes to empty content with (edited) in Search - Chat page #48810

Closed IuliiaHerets closed 2 weeks ago

IuliiaHerets commented 2 weeks ago

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: 9.0.31-0 Reproducible in staging?: Y Reproducible in production?: N/A Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to DM.
  3. Send a message.
  4. Go to Search > Chat.
  5. Go to Sent.
  6. Click on the message sent in Step 3.
  7. Send another message in report RHP.
  8. Delete the first message sent in Step 3.

Expected Result:

The deleted message will be removed from Search - Chat page.

Actual Result:

The deleted message changes to empty content with (edited) in Search - Chat page.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/e890fb95-b2d0-4e4e-9d59-9bc9da3b0620

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @strepanier03
melvin-bot[bot] commented 2 weeks ago

Triggered auto assignment to @robertjchen (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] commented 2 weeks ago

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

github-actions[bot] commented 2 weeks ago

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
IuliiaHerets commented 2 weeks ago

We think that this bug might be related to #wave-control

etCoderDysto commented 2 weeks ago

Edited by proposal-police: This proposal was edited at 2024-09-09 18:50:51 UTC.

Proposal

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

Search - Deleted message changes to empty content with (edited) in Search - Chat page

What is the root cause of that problem?

We are not checking if a reportAction is deleted before adding it to reportActionItems https://github.com/Expensify/App/blob/61ee515eb384ed07d70c2d982f27ca46477eed5a/src/libs/SearchUtils.ts#L203-L209

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

We should check if a report action is deleted before adding it to reportActionItems

const isDeleted = isDeletedAction(reportAction);
if (!isDeleted) {
        const from = data.personalDetailsList?.[reportAction.accountID];
       reportActionItems.push({
      ...reportAction,
      from,
      formattedFrom: from?.displayName ?? from?.login ?? '',
      date: reportAction.created,
      keyForList: reportAction.reportActionID,
     });
}

What alternative solutions did you explore? (Optional)

We can use shouldReportActionBeVisible to cover other cases in adition to deleted messages

const shouldShowReportAction = ReportActionsUtils.shouldReportActionBeVisible(reportAction, reportAction.reportActionID);
if (shouldShowReportAction) {
  reportActionItems.push({
      ...reportAction,
      from,
      formattedFrom: from?.displayName ?? from?.login ?? '',
      date: reportAction.created,
      keyForList: reportAction.reportActionID,
     });
}
luacmartins commented 2 weeks ago

I'll take this since it's part of Search. cc @shubham1206agra @ikevin127

luacmartins commented 2 weeks ago

CPing fix

luacmartins commented 2 weeks ago

Fixed in staging.

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.31-26 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-09-18. :confetti_ball:

melvin-bot[bot] commented 2 weeks ago

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: