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

add LHN label for deleted messages #3979

Merged

Conversation

dklymenk
Copy link
Contributor

@dklymenk dklymenk commented Jul 12, 2021

Details

This PR fixes two LHN issues related to comment deletion by showing a translatable "[Comment deleted]" message, if last message was deleted.

Fixed Issues

$ #3743
$ #3293

Tests / QA Steps

  1. Send a message. You should see it in LHN.
  2. Delete that message. The LHN should say "[Comment deleted]".

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

3747-3293-web.mp4

Mobile Web

Simulator.Screen.Recording.-.iPhone.8.-.2021-07-12.at.15.19.55.mp4

Desktop

Screen.Recording.2021-07-12.at.15.22.22.mov

iOS

Simulator.Screen.Recording.-.iPhone.12.-.2021-07-12.at.15.28.56.mp4

Android

3747-3293-android.mp4

@@ -166,7 +166,7 @@ function getSimplifiedReportObject(report) {
// We convert the line-breaks in html to space ' ' before striping the tags
const lastMessageText = lodashGet(lastReportAction, ['message', 'html'], '')
.replace(/((<br[^>]*>)+)/gi, ' ')
.replace(/(<([^>]+)>)/gi, '');
.replace(/(<([^>]+)>)/gi, '') || `[${translateLocal('common.deletedCommentMessage')}]`;
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmmm, can you make sure to escape any character that has a meaning in regex? Right now there's no risk, but it would be very easy for a translation to include a dot or some other character that regexes would treat differently than just a text (same below).

Copy link
Contributor Author

@dklymenk dklymenk Jul 12, 2021

Choose a reason for hiding this comment

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

I'm sorry I'm not following. The translated text is not checked against any regular expression and isn't treated as a regular expression. I'm not sure what's the concern here. Can you please rephrase it somehow maybe?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh sorry, you are right, I misread this.

@dklymenk
Copy link
Contributor Author

Tagging @NikkiWines since this PR also fixes #3293 .

@@ -166,7 +166,7 @@ function getSimplifiedReportObject(report) {
// We convert the line-breaks in html to space ' ' before striping the tags
const lastMessageText = lodashGet(lastReportAction, ['message', 'html'], '')
.replace(/((<br[^>]*>)+)/gi, ' ')
.replace(/(<([^>]+)>)/gi, '');
.replace(/(<([^>]+)>)/gi, '') || `[${translateLocal('common.deletedCommentMessage')}]`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh sorry, you are right, I misread this.

@iwiznia iwiznia merged commit f61e6d9 into Expensify:main Jul 12, 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.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging in version: 1.0.77-6🚀

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

@chiragsalian
Copy link
Contributor

chiragsalian commented Jul 15, 2021

The PR caused a deploy blocker so I had to manually revert it here.

@dklymenk
Copy link
Contributor Author

@chiragsalian Yes, this code probably should not have been deployed to staging, however the PR itself is good.

The issue you are referring to is caused by #3737. We discussed it here with @iwiznia : #3743 (comment)

Should I create a new PR that reverts your revert, so we don't forget about it until #3737 is fixed?

@chiragsalian
Copy link
Contributor

Yeah so i think my revert should be cherry picked to staging so that it unblocks deploy. You can go ahead and create a revert of my revert now or later so that its not forgotten, whichever your preference is.

Then once #3737 is fixed you'll just merge the new PR so that both go to staging together. Does that plan sound good with you?

@dklymenk
Copy link
Contributor Author

Yes, that sounds good to me. As far as I understand the fix for #3737 is BE only, so we wouldn't need to care about those fixes going to staging together as much. But other than that your plan sounds good.

I'll create a PR later.

Thanks.

@dklymenk dklymenk deleted the 3743-3293-add-LHN-label-for-deleted-messages branch July 18, 2021 09:00
@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.79-4🚀

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