Skip to content

Remove "Comment Deleted" message - #7711

Merged
luacmartins merged 12 commits into
mainfrom
cmartins-rmDeletedComment
Mar 1, 2022
Merged

luacmartins merged 12 commits into
mainfrom
cmartins-rmDeletedComment

Conversation

@luacmartins

@luacmartins luacmartins commented Feb 11, 2022 •

Copy link
Copy Markdown
Contributor

Details

Simply deletes a comment instead of showing [Comment deleted]

Fixed Issues

$ #7646

Tests

  1. Pull the Auth PR changes and run ./script/makeAll.sh
  2. Send multiple messages to another user
  3. Delete some messages and notice that the message completely disappears
  4. Delete the last message sent and verify that the last message in the LHN is updated accordingly
  5. Refresh the app and notice that the last message in the LHN is correct

Note: if the LHN message does not update, you might have to make clean and run ./script/makeAll.sh again.

  • Verify that no errors appear in the JS console

QA Steps

Steps 2-4 above.

  • Verify that no errors appear in the JS console

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

web.mov

Mobile Web

mweb.mov

Desktop

desktop.mov

iOS

ios.mov

Android

android.mov

@luacmartins luacmartins self-assigned this Feb 11, 2022
@luacmartins
luacmartins marked this pull request as ready for review February 15, 2022 15:31
@luacmartins
luacmartins requested a review from a team as a code owner February 15, 2022 15:31
@MelvinBot
MelvinBot requested review from MonilBhavsar and removed request for a team February 15, 2022 15:31
MonilBhavsar
MonilBhavsar previously approved these changes Feb 16, 2022

@MonilBhavsar MonilBhavsar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!
Would like to have eyes from someone more familiar
@marcaaron will you please review this since you were involved in issue discussion

@marcaaron marcaaron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice job! I have a couple of questions. Mostly around where we are updating the reportAction and whether we are updating the report object twice.

Comment thread src/libs/actions/Report.js Outdated

// If the message is deleted, update the last read in case the deleted message is being counted in the unreadActionCount
// If the message is deleted, we should
// 1. update the last read in case the deleted message is being counted in the unreadActionCount

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Capitalize Update?

Also, I don't entirely understand this comment "in case the deleted message is being counted". Can we tell if the deleted message is counted in the unreadActionCount or not? This comment reads like "maybe we need to do this".

@luacmartins luacmartins Feb 24, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems that we are not counting deleted messages in unreadActionCount since we subtract it from the total count here. I'm not sure why we had that comment. I'll do some more digging.

@luacmartins luacmartins Feb 24, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems that we are not counting deleted messages in unreadActionCount, but we want to update the last read and the counter anyways. I updated the comment to make it clear.

Comment thread src/libs/actions/Report.js Outdated
if (sequenceNumber === reportMaxSequenceNumbers[reportID]) {
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {
lastMessageText: ReportUtils.formatReportLastMessageText(message.text) || `[${Localize.translateLocal('common.deletedCommentMessage')}]`,
lastMessageText: ReportActions.getLastMessageText(reportID),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm having trouble thinking of a better naming suggestion, but feels maybe not very obvious that ReportActions .getLastMessageText() would filter out deleted messages.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea, I struggled with that too. Maybe getLastVisibleMessageText or getLastRemainingMessageText?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like getLastVisibleMessageText() there might be others we hide for reasons besides "deleting" in the future.

Comment thread src/libs/actions/Report.js Outdated
// If this is the most recent message and it wasn't deleted, update the lastMessageText in the report object as well
const lastMessageText = ReportUtils.formatReportLastMessageText(message.text);
if (lastMessageText && sequenceNumber === reportMaxSequenceNumbers[reportID]) {
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {lastMessageText});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm confused about why we are doing this step here. It looks like we would:

  1. call this once
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {lastMessageText})
  1. the promise above resolves and then we set the lastMessageText again on line 559

Is that intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My memory is failing me and now I'm confused too 😅 I'll do some more testing and try to figure out why I thought this was necessary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, I added the call inside then to update deleted messages and kept it outside to update edited messages. I think we can simplify this and just call it when the promise resolves.

@luacmartins

Copy link
Copy Markdown
Contributor Author

Updated!

@marcaaron marcaaron left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, thanks for the changes!

@marcaaron

Copy link
Copy Markdown
Contributor

Approving, but should this be on HOLD until the Auth change?

@luacmartins luacmartins changed the title Remove "Comment Deleted" message [HOLD Auth #6430] Remove "Comment Deleted" message Feb 25, 2022
@luacmartins luacmartins changed the title [HOLD Auth #6430] Remove "Comment Deleted" message Remove "Comment Deleted" message Mar 1, 2022
@luacmartins

Copy link
Copy Markdown
Contributor Author

Hold removed! Self-merging with approval!

@luacmartins
luacmartins merged commit 572caa9 into main Mar 1, 2022
@luacmartins
luacmartins deleted the cmartins-rmDeletedComment branch March 1, 2022 15:35
@OSBotify

OSBotify commented Mar 1, 2022

Copy link
Copy Markdown
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 OSBotify mentioned this pull request Mar 1, 2022
68 tasks done
@OSBotify

OSBotify commented Mar 1, 2022

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by @luacmartins in version: 1.1.41-0 🚀

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

@OSBotify

OSBotify commented Mar 2, 2022

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by @luacmartins in version: 1.1.41-0 🚀

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by @francoisl in version: 1.1.41-6 🚀

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

@Stutikuls

Stutikuls commented Mar 11, 2022 •

Copy link
Copy Markdown

Issue 1 -

Title- [High] Keyboard : Controls(Edit, Delete, etc.) are not appearing using keyboard.
Actual -Controls(Edit, Delete, etc.) are not appearing using keyboard, displayed on hover.
Expected - Controls(Edit, Delete, etc.) should appear using keyboard.
WCAG failure - 1.4.13
Reproducible in staging?: - Yes
Version Number: - v1.1.42-2
Platforms - Web(Chrome + Jaws), Desktop (MAC), Mobile-web (iOS-Safari + Voiceover), iOS, Android

7711_.Controls.Edit.Delete.etc.are.not.appearing.using.keyboard.mp4

Issue 2 -

Title- [High] Keyboard : Role is not defined for 'Delete' & 'Cancel' control.
Actual -Role is not defined for 'Delete' & 'Cancel' control. Screen reader only reads name of the controls.
Expected - Role - 'Button' should define for 'Delete' & 'Cancel' control.
WCAG failure - 1.4.2
Reproducible in staging?: - Yes
Version Number: - v1.1.42-2
Platforms - Web(Chrome + Jaws), Desktop (MAC), Mobile-web (iOS-Safari + Voiceover), iOS

7711_Role.is.not.defined.for.Delete.Cancel.control.mp4

Issue 3 -

Title- [High] Keyboard : Role is not defined for 'Delete comment' control.
Actual -Role is not defined for 'Delete comment' control. Screen reader only reads name of the control.
Expected - Role - 'Button' should define for 'Delete comment' control.
WCAG failure - 1.4.2
Reproducible in staging?: - Yes
Version Number: - v1.1.42-2
Platforms - Web(Chrome + Jaws), Desktop (MAC), Mobile-web (iOS-Safari + Voiceover), iOS

7711_Role.is.not.defined.for.Delete.Cancel.control.mp4

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.

5 participants