Fix bugs surrounding report name when deleting first thread comment#23514
Conversation
| lastVisibleActionCreated: '', | ||
| }; | ||
| if (reportAction.reportActionID && reportAction.childVisibleActionCount > 0) { | ||
| if (reportAction.reportActionID && reportAction.childVisibleActionCount === 0) { |
There was a problem hiding this comment.
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.
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.
If there is a reason it should have been documented better 🤷♂️
|
|
||
| // 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.
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.
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] |
|
@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
parentReportActionfor 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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