-
Notifications
You must be signed in to change notification settings - Fork 1.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 an issue with avatars not loading in suggestions #21169
Conversation
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
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.
Change looks good! Tested and verified avatars now work. I didn't test blavatars though, but it seems like they work very similarly.
@@ -129,7 +129,7 @@ - (WPAvatarSourceType)parseURL:(NSURL *)url forAvatarHash:(NSString **)avatarHas | |||
if ([components count] > 2) { | |||
NSString *type = components[1]; | |||
NSString *hash = components[2]; | |||
if ([hash length] == 32) { | |||
if ([hash length] == 32 || [hash length] == 64) { |
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.
This makes sense given the hash is now 64 characters 👍
nitpick: I don't know why this has to verify the hash's length, since it seems unlikely we'll get the wrong length and if we do, I don't think there's harm in it. What will happen AFAIK is that we'll just request the avatar/blavatar and it'll fail.
If this targets |
Fixes #21155
The reason it's not working is the following change to the avatar hashes: pb6Nl-gyD-p2.
The proper fix will require a little more work. The app shouldn't make any assumptions about the contents of these identifiers. It should also not use
WPAvatarSource
because it's yet another non-centralized image loading system in the app with its own cache, which contributes to high memory usage issues, and it fails to reuse the caches and there work for fetching the same avatars in other places of the app.To test:
Regression Notes
PR submission checklist:
RELEASE-NOTES.txt
if necessary.UI Changes testing checklist: