-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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/14842: Message sent is not updated in the search page when a new message arrives #15030
Conversation
@puneetlath @thesahindia 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] |
src/pages/SearchPage.js
Outdated
@@ -75,6 +75,13 @@ class SearchPage extends Component { | |||
}; | |||
} | |||
|
|||
componentDidUpdate(prevProps) { | |||
if (_.isEqual(prevProps.reports, this.props.reports) && _.isEqual(prevProps.personalDetails, this.props.personalDetails) && _.isEqual(prevProps.betas, this.props.betas)) { |
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 can just check for the whole prop object like you had proposed, I don't feel this is something significant.
I will defer to @puneetlath on 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.
@thesahindia I just fixed it
@puneetlath, I think we need to take a second look at this. I just checked other pages and this issue is present there as well. If a user updates their name the name doesn't change in invite members page and new chat/group page as well. I think we should look for a better solution which doesn't revolve around updating the state. I think we should close this PR for now, update the issue and start over. |
It's a fair question of whether its even worth updating these more "temporary" style search dialogs with the latest data given that they aren't really static pages, but dialogs you interact with temporarily. Let's start a discussion in #open-source about it. Don't worry @tienifr you will be compensated for your work no matter what we ultimately decide. |
|
Ok let's go ahead and close this PR as we've decided not to fix. |
Details
When the reports, personalDetails, betas props changes, we need to update the subtitle of the option (it is the last message with this user) and displayName. So, we need to update the option list when some props change. This PR does that
Fixed Issues
$ #14842
$ #14842 (comment)
Tests
Case 1: Send a message from user B to user A and verify that the subtitle of UserB's option is updated immediately
Case 2: Update the display name in user B and verify that the display name of UserB's option is updated immediately
Offline tests
QA Steps
Case 1: Send a message from user B to user A and verify that the subtitle of UserB's option is updated immediately
Case 2: Update the display name in user B and verify that the display name of UserB's option is updated immediately
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.Screenshots/Videos
Web
Screen.Recording.2023-02-10.at.10.37.55.mp4
Mobile Web - Chrome
329290413_9024525117587622_5147537344537907453_n.mp4
Mobile Web - Safari
Screen.Recording.2023-02-10.at.10.45.12.mp4
Desktop
Screen.Recording.2023-02-10.at.10.47.40.mp4
iOS
Screen.Recording.2023-02-10.at.10.54.52.mp4
Android
Screen.Recording.2023-02-10.at.11.10.33.mp4