-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix bugs surrounding report name when deleting first thread comment #23514
Conversation
src/libs/actions/Report.js
Outdated
@@ -897,7 +897,7 @@ function deleteReportComment(reportID, reportAction) { | |||
lastMessageText: '', | |||
lastVisibleActionCreated: '', | |||
}; | |||
if (reportAction.reportActionID && reportAction.childVisibleActionCount > 0) { | |||
if (reportAction.reportActionID && reportAction.childVisibleActionCount === 0) { |
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.
Do we need to check reportAction.reportActionID
here?
const optimisticReportActions = {
[reportActionID]: {
Doesn't this imply it's truthy? If it's still needed, can it be replaced with if (reportActionID && ...
?
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.
That's a good point. If it's not defined then something is wrong because we are about to save an object with a key of undefined
. I think this was probably just overly cautious programming.
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.
If there is a reason it should have been documented better 🤷♂️
src/libs/actions/Report.js
Outdated
|
||
// This may appear to be unused, but we don't use this field for anything other than to trigger an | ||
// update to the LHN that the report action we are deleting is the first message of a thread. | ||
value: {isParentReportActionDeleted: true}, |
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.
NAB but just an idea to make it more in line with the comment
value: {isParentReportActionDeleted: true}, | |
value: {updateReportInLHN: true}, |
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, yes, I prefer this. It solves my concern about people trying to use isParentReportActionDeleted
for things when it may be unreliable.
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-07-25.at.4.39.47.AM.movMobile Web - ChromeScreen.Recording.2023-07-25.at.4.44.21.AM.movMobile Web - SafariScreen.Recording.2023-07-25.at.4.42.52.AM.movDesktopScreen.Recording.2023-07-25.at.4.48.59.AM.moviOSScreen.Recording.2023-07-25.at.4.45.53.AM.movAndroidScreen.Recording.2023-07-25.at.4.47.21.AM.mov |
@allroundexperts Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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.
Tests well!
@robertjchen Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Fix bugs surrounding report name when deleting first thread comment (cherry picked from commit fbfabee)
✋ 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 https://github.com/marcaaron in version: 1.3.44-2 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.44-2 🚀
|
Details
There are two issues being fixed here:
Ideally, we would subscribe to the
parentReportAction
for the thread report here. I couldn't find an easy way to do this as we must check to see if the report is a thread and then subscribe to just the first report action (not possible with Onyx selectors AFAICT).Fixed Issues
$ #23401
Tests
The subtitle of the initial chat has the correct "last message"
The title of the thread chat says
[Deleted message]
and it's subtitle reflects the correct "last message" for the thread.Verify that no errors appear in the JS console
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Full disclosure iOS sim issues prevented me from testing
Desktop
iOS
Full disclosure iOS sim issues prevented me from testing
Android