Skip to content
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 update image on account screen when updating profile image #7978

Merged
merged 1 commit into from
May 31, 2024
Merged

Conversation

enahum
Copy link
Contributor

@enahum enahum commented May 31, 2024

Summary

For some reason the author changes was not being picked up by the useMemo, now we are getting the last time the user updated the picture as part of the dependencies of the memo in order to trigger it and update the url of the profile picture.

Ticket Link

https://mattermost.atlassian.net/browse/MM-58501

Release Note

NONE

@enahum enahum added 2: Dev Review Requires review by a core commiter CherryPick/Approved Meant for the quality or patch release tracked in the milestone 3: QA Review Requires review by a QA tester labels May 31, 2024
@enahum enahum added this to the v2.17.0 milestone May 31, 2024
@lindalumitchell lindalumitchell added the Build Apps for PR Build the mobile app for iOS and Android to test label May 31, 2024
@lindalumitchell lindalumitchell self-requested a review May 31, 2024 05:04
Copy link
Contributor

@lindalumitchell lindalumitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally caught up with this issue this evening so I went ahead and tested on the PR builds while I was poking around, and verified first that I was able to reproduce on iOS (Lindy repro'ed on Android), and then verified that the issue is fixed on both iOS and Android builds. 👍

@lindalumitchell lindalumitchell removed the 3: QA Review Requires review by a QA tester label May 31, 2024
@lindy65 lindy65 removed their request for review May 31, 2024 06:19
@lindy65
Copy link

lindy65 commented May 31, 2024

Thanks for testing @lindalumitchell 🤗

@amyblais amyblais removed their request for review May 31, 2024 11:52
Copy link
Member

@hmhealey hmhealey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I posted a couple thoughts below, but this seems like it'll fix the issue regardless

@@ -56,7 +58,7 @@ const Image = ({author, forwardRef, iconSize, size, source, url}: Props) => {

const pictureUrl = buildProfileImageUrlFromUser(serverUrl, author);
return source ?? {uri: buildAbsoluteUrl(serverUrl, pictureUrl)};
}, [author, serverUrl, source]);
}, [author, serverUrl, source, lastPictureUpdateAt]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit concerning that this needs to be passed in separately since that sounds like author is being mutated for it to not cause imgSource to be updated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk why is happening but yes I agree, i did not want to spend tons of time on this

@@ -56,7 +58,7 @@ const Image = ({author, forwardRef, iconSize, size, source, url}: Props) => {

const pictureUrl = buildProfileImageUrlFromUser(serverUrl, author);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid someone potentially removing lastPictureUpdateAt in the future because it's unused in the body of the useMemo, you might want to change this to use buildProfileImageUrl so that it explicitly uses lastPictureUpdateAt in here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is better, perhaps you can make that fhange @hmhealey and merge the PR as I'm already embracing the pillow :)

@hmhealey hmhealey added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels May 31, 2024
@larkox larkox merged commit 83e4aba into main May 31, 2024
22 checks passed
@larkox larkox deleted the MM-58501 branch May 31, 2024 14:44
@mattermost-build
Copy link
Contributor

Cherry pick is scheduled.

mattermost-build pushed a commit that referenced this pull request May 31, 2024
@mattermost-build mattermost-build added CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone and removed CherryPick/Approved Meant for the quality or patch release tracked in the milestone labels May 31, 2024
larkox pushed a commit that referenced this pull request May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request Build Apps for PR Build the mobile app for iOS and Android to test CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants