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 "Comment Deleted" message #7711

Merged
merged 12 commits into from
Mar 1, 2022
Merged

Conversation

luacmartins
Copy link
Contributor

@luacmartins luacmartins commented Feb 11, 2022

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
Copy link
Contributor

@MonilBhavsar MonilBhavsar left a comment

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

Copy link
Contributor

@marcaaron marcaaron left a comment

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.

@@ -551,15 +551,19 @@ function updateReportActionMessage(reportID, sequenceNumber, message) {
return;
}

// 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
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".

Copy link
Contributor Author

@luacmartins luacmartins Feb 24, 2022

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.

Copy link
Contributor Author

@luacmartins luacmartins Feb 24, 2022

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.

Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {
lastMessageText: ReportUtils.formatReportLastMessageText(message.text) || `[${Localize.translateLocal('common.deletedCommentMessage')}]`,
lastMessageText: ReportActions.getLastMessageText(reportID),
Copy link
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
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
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.

// 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
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
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
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
Contributor Author

Updated!

Copy link
Contributor

@marcaaron marcaaron left a comment

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
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
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
Copy link
Contributor

OSBotify commented Mar 1, 2022

✋ 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

OSBotify commented Mar 1, 2022

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

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

@OSBotify
Copy link
Contributor

OSBotify commented Mar 2, 2022

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

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

@OSBotify
Copy link
Contributor

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

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

@Stutikuls
Copy link

Stutikuls commented Mar 11, 2022

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