-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
There was a problem hiding this 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
There was a problem hiding this 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.
src/libs/actions/Report.js
Outdated
@@ -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 |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/libs/actions/Report.js
Outdated
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, { | ||
lastMessageText: ReportUtils.formatReportLastMessageText(message.text) || `[${Localize.translateLocal('common.deletedCommentMessage')}]`, | ||
lastMessageText: ReportActions.getLastMessageText(reportID), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
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}); |
There was a problem hiding this comment.
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:
- call this once
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {lastMessageText})
- the promise above resolves and then we set the
lastMessageText
again on line 559
Is that intentional?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Updated! |
There was a problem hiding this 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!
Approving, but should this be on HOLD until the Auth change? |
Hold removed! Self-merging with approval! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @luacmartins in version: 1.1.41-0 🚀
|
🚀 Deployed to staging by @luacmartins in version: 1.1.41-0 🚀
|
🚀 Deployed to production by @francoisl in version: 1.1.41-6 🚀
|
Issue 1 - Title- [High] Keyboard : Controls(Edit, Delete, etc.) are not appearing using keyboard. 7711_.Controls.Edit.Delete.etc.are.not.appearing.using.keyboard.mp4Issue 2 - Title- [High] Keyboard : Role is not defined for 'Delete' & 'Cancel' control. 7711_Role.is.not.defined.for.Delete.Cancel.control.mp4Issue 3 - Title- [High] Keyboard : Role is not defined for 'Delete comment' control. 7711_Role.is.not.defined.for.Delete.Cancel.control.mp4 |
Details
Simply deletes a comment instead of showing
[Comment deleted]
Fixed Issues
$ #7646
Tests
./script/makeAll.sh
Note: if the LHN message does not update, you might have to
make clean
and run./script/makeAll.sh
again.QA Steps
Steps 2-4 above.
Tested On
Screenshots
Web
web.mov
Mobile Web
mweb.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov