group-income icon indicating copy to clipboard operation
group-income copied to clipboard

Profile picture is not updated after setting it

Open taoeffect opened this issue 1 year ago • 3 comments

Problem

While I was testing with GI_PERSIST=sqlite grunt dev, I set a profile picture using the avatar uploader. You can see it says "Avatar updated!" but the profile picture is still the red blockies:

Screenshot 2024-02-20 at 9 38 36 AM

If I refresh the page, however, the updated profile picture appears on my user.

Likewise, for any other users in the group, the profile picture is not updated immediately. Other users have to refresh the page for the profile picture to appear.

EDIT: this seems to only happen sometimes! 😱

Solution

The profile picture should be immediately updated.

This issue is possibly related to #1840.

taoeffect avatar Feb 20 '24 17:02 taoeffect

Actually, a page refresh isn't even needed. The Vuex data does get updated instantly. But the AvatarUser.vue component doesn't get updated immediately. It does get updated if, for example, we close the modal, and re-open it. Or if we switch from the dashboard to some other page (like Contributions) and back to the Dashboard, the AvatarUser profile picture in the users list does get updated.

This happened here:

Screenshot 2024-02-21 at 10 03 58 AM

Notice the avatar in the lower-left is different from the one in the user list. This is because the page switched to the Contributions component and back to the dashboard, causing a redraw of the AvatarUser component in the user list, but not in the lower-left (because that wasn't redrawn).

It seems like a manual redraw / forceUpdate is needed on this component when the avatar changes.

taoeffect avatar Feb 21 '24 18:02 taoeffect

@taoeffect, can you please upload the video to reproduce this error? I tried many times, but could not reproduce this one.

Silver-IT avatar Feb 28 '24 00:02 Silver-IT

@Silver-IT I cannot reproduce it anymore either. And in the issue I mentioned that I can't reproduce it every time. So, I'm not sure, if you can't reproduce it, don't worry about it for now.

taoeffect avatar Feb 28 '24 01:02 taoeffect