Fix crash while changing contact method#19941
Conversation
|
@NikkiWines @allroundexperts One of you needs to 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] |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-06-01.at.4.36.27.PM.movMobile Web - ChromeScreen.Recording.2023-06-01.at.4.48.49.PM.movMobile Web - SafariScreen.Recording.2023-06-01.at.4.48.16.PM.movDesktopScreen.Recording.2023-06-01.at.4.43.12.PM.moviOSScreen.Recording.2023-06-01.at.4.50.13.PM.movAndroidScreen.Recording.2023-06-01.at.4.49.34.PM.mov |
|
@hungvu193 Can you use |
|
Also, lets just keep on using |
So you still want to use |
Yes. Just pass |
|
Cool, I've just updated @allroundexperts |
| const reportRecipient = this.props.personalDetails[participantsWithoutExpensifyEmails[0]]; | ||
| const shouldShowReportRecipientLocalTime = ReportUtils.canShowReportRecipientLocalTime(this.props.personalDetails, this.props.report) && !this.props.isComposerFullSize; | ||
| const shouldShowReportRecipientLocalTime = | ||
| ReportUtils.canShowReportRecipientLocalTime(this.props.personalDetails, this.props.report, this.props.currentUserPersonalDetails.login) && !this.props.isComposerFullSize; |
There was a problem hiding this comment.
@hungvu193 Please verify if canShowReportRecipientLocalTime function isn't used elsewhere. If so, then add this third parameter at other places as well!
There was a problem hiding this comment.
Nice catch, I should notice this earlier.
Thank you @allroundexperts . I've just updated it again!
|
@hungvu193 In the uploaded videos, I don't see the |
|
That's not the requirement I believe, lemme update the steps. 😀 |
|
Updated! |
@hungvu193 I think instead of |
|
Tested and updated the steps as well @allroundexperts |
allroundexperts
left a comment
There was a problem hiding this comment.
Looks good!
All yours @NikkiWines!
NikkiWines
left a comment
There was a problem hiding this comment.
Looks good, but @hungvu193 can you update your QA + testing steps to clarify what you mean by "Go to any thread or report that has participant time." please 🙇
|
Thanks @NikkiWines . I updated it again! |
|
✋ 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/NikkiWines in version: 1.3.23-0 🚀
|
|
🚀 Deployed to staging by https://github.com/NikkiWines in version: 1.3.23-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.23-7 🚀
|
1 similar comment
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.23-7 🚀
|
|
|
||
| render() { | ||
| const reportRecipientDisplayName = this.props.participant.firstName || this.props.participant.displayName; | ||
| const reportRecipientDisplayName = lodashGet(this.props, 'participant.firstName') || lodashGet(this.props, 'participant.displayName'); |
There was a problem hiding this comment.
We should not be using the lodashGet here. participant prop is required here. So should never be rendering this component if participant is not present. In case, participant is undefined here, it mean the root cause is in upper tree not here.
cc: @NikkiWines
There was a problem hiding this comment.
This is just a safe guard. We've fixed the root cause as well.
There was a problem hiding this comment.
This safe guard promotes more bugs. No one should be able to use this component without passing the participation and error should be thrown to make it clear during development. This should be reverted.
Details
Fix crash while changing contact method
Fixed Issues
$ #19611
PROPOSAL: #19611 (comment)
Tests
Offline tests
Bug is related to offline mode itself. No extra steps needed.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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
Web
contact.method.mov
Mobile Web - Chrome
Screen.Recording.2023-06-01.at.13.45.02.mov
Mobile Web - Safari
Screen.Recording.2023-06-01.at.13.43.00.mov
Desktop
desktop.mov
iOS
Screen.Recording.2023-06-01.at.13.41.21.mov
Android
Screen.Recording.2023-06-01.at.13.45.58.mov