-
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 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 |
@@ -906,7 +906,8 @@ class ReportActionCompose extends React.Component { | |||
const reportParticipants = _.without(lodashGet(this.props.report, 'participants', []), this.props.currentUserPersonalDetails.login); | |||
const participantsWithoutExpensifyEmails = _.difference(reportParticipants, CONST.EXPENSIFY_EMAILS); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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!
All yours @NikkiWines!
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, 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 🚀
|
@@ -53,7 +53,7 @@ class ParticipantLocalTime extends PureComponent { | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a safe guard. We've fixed the root cause as well.
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.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
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