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

remove deleted comment message on new chats #6458

Conversation

dklymenk
Copy link
Contributor

@dklymenk dklymenk commented Nov 24, 2021

Details

This PR addresses a bug caused by my previous PR #4133.

Fixed Issues

$ #3743
$ #3293
$ #6426

Tests / QA Steps

  1. Create a new chat with a user you haven't ever sent any messages to.
  2. LHN should be updated with the new chat.
  3. The LHN should have user's email or phone number and not "[Comment deleted]".

Tested On

I am unable to test on iOS at the moment as the app is constantly stuck on splash screen for me.

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

6456-web.mp4

Mobile Web

Simulator.Screen.Recording.-.iPhone.12.-.2021-11-24.at.18.04.10.mp4

Desktop

Screen.Recording.2021-11-24.at.18.09.49.mov

iOS

Android

6468-android.mp4

Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment

const lastMessageText = lastActionMessage
.replace(/((<br[^>]*>)+)/gi, ' ')
.replace(/(<([^>]+)>)/gi, '') || `[${translateLocal('common.deletedCommentMessage')}]`;
let lastMessageText;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do this instead and save a couple of lines

    let lastMessageText = null;
    if (report.reportActionCount > 0) {
        // We are removing any html tags from the message html since we cannot access the text version of any comments as
        // the report only has the raw reportActionList and not the processed version returned by Report_GetHistory
        // We convert the line-breaks in html to space ' ' before striping the tags
        lastMessageText = lastActionMessage
            .replace(/((<br[^>]*>)+)/gi, ' ')
            .replace(/(<([^>]+)>)/gi, '') || `[${translateLocal('common.deletedCommentMessage')}]`;
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch. I have pushed the suggested changes.

Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works well 👍

@NikkiWines NikkiWines merged commit 0aa9834 into Expensify:main Nov 24, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@chiragsalian
Copy link
Contributor

Looks like this issue addressed the deploy blocker - #6426.
I'll CP-d this to staging so that QA can test and confirm.

github-actions bot pushed a commit that referenced this pull request Nov 24, 2021
…ed-message-on-new-chat

remove deleted comment message on new chats

(cherry picked from commit 0aa9834)
@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by @chiragsalian in version: 1.1.16-8 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.16-10 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @NikkiWines in version: 1.1.16-11 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Dec 6, 2021

🚀 Deployed to production by @roryabraham in version: 1.1.17-7 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants