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

Add one time force refresh ability for CachedAsyncImage and AvatarView #644

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

pinarol
Copy link
Contributor

@pinarol pinarol commented Jan 22, 2025

Closes Described here #615 (review) (see "it does not refresh" part)

Description

We need to force refresh the avatar just once when the avatar selection changes. Previously I did that by setting forceRefresh to true and then false with a little delay but sometimes the underlying system can ignore the true value somehow. So I added a new binding just for one time refreshing purpose, which is actually the real need here. This way we can set the flag back to false after the call is really done.

Testing Steps

  • Switch between avatars many times or delete the selected avatar
  • Make sure the avatar in the QE's profile card gets updated

@pinarol pinarol self-assigned this Jan 22, 2025
@pinarol pinarol changed the title One time force refresh when avatar changes Add one time force refresh ability for CachedAsyncImage and AvatarView Jan 22, 2025
@wpmobilebot
Copy link

Gravatar Prototype Build📲 You can test the changes from this Pull Request in Gravatar Prototype Build by scanning the QR code below to install the corresponding build.
App NameGravatar Prototype Build Gravatar Prototype Build
Build Number2042
Version1.0
Bundle IDcom.automattic.gravatar-sdk-demo-uikit.prototype-build
Commit7b9ef0a
App Center BuildGravatar SDK Demo - UIKit #565
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@pinarol pinarol added bug Something isn't working [Feature] Gravatar-QuickEditor Gravatar Quick Editor [Priority] Medium labels Jan 22, 2025
@pinarol pinarol marked this pull request as ready for review January 22, 2025 09:27
Base automatically changed from wppinar/refresh-profile-on-upload to release/3.2.0 January 22, 2025 14:10
Copy link
Contributor

@andrewdmontgomery andrewdmontgomery left a comment

Choose a reason for hiding this comment

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

This approach looks better. Nice. Testing seems to work great, too. I ran into a bug, but it's happening on the release/3.2 branch also. And to some degree, it also happens on the release/3.1.1 commit. I'll create an issue.

@pinarol pinarol merged commit f49296d into release/3.2.0 Jan 23, 2025
19 checks passed
@pinarol pinarol deleted the wppinar/oneTimeForceRefresh branch January 23, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working [Feature] Gravatar-QuickEditor Gravatar Quick Editor [Priority] Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants