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

Set the cache buster value in the initial state #557

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

AdamGrzybkowski
Copy link
Contributor

Closes #548

Description

The cache buster param is not set when initializing the AvatarPickerViewModel so we do load a cached image. This PR sets the value in the state initialization to fix that.

Before After
cached_avatar_before avatar_cache_after

Testing Steps

  1. Launch the QE
  2. Select a different avatar
  3. Reopen the QE
  4. Confirm the Avatar in the Profile card is up to date

@AdamGrzybkowski AdamGrzybkowski added Bug Something isn't working [Feature] Gravatar-Quickeditor Gravatar Quick Editor module labels Jan 24, 2025
@AdamGrzybkowski AdamGrzybkowski added this to the 2.3.0 milestone Jan 24, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 24, 2025

📲 You can test the changes from this Pull Request in Gravatar Demo by scanning the QR code below to install the corresponding build.
App Name Gravatar Demo
Commit2652c6e
Direct Downloadgravatar-demo-prototype-build-pr557-2652c6e.apk

@mlumeau
Copy link
Member

mlumeau commented Jan 24, 2025

Wouldn't it be simpler to set the default value in the AvatarPickerUiState to 0 instead of null?

@AdamGrzybkowski
Copy link
Contributor Author

Wouldn't it be simpler to set the default value in the AvatarPickerUiState to 0 instead of null?

0 is not a great cache buster, because it's not unique. If you try to do the testing steps quickly, you will see it doesn't fix the problem.

Copy link
Member

@mlumeau mlumeau left a comment

Choose a reason for hiding this comment

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

Couldn't reproduce the issue with these changes so I guess it fixed it 👍

@AdamGrzybkowski AdamGrzybkowski force-pushed the adam/548_initial_image_cached branch from a12ca77 to 2652c6e Compare January 24, 2025 14:13
@AdamGrzybkowski AdamGrzybkowski merged commit 5da9063 into trunk Jan 24, 2025
17 checks passed
@AdamGrzybkowski AdamGrzybkowski deleted the adam/548_initial_image_cached branch January 24, 2025 14:29
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 module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QuickEditor: Old image shown on initial QE launch
3 participants