-
Notifications
You must be signed in to change notification settings - Fork 12
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
Extra profile refresh for the new users #615
Conversation
|
App Name | ||
Build Number | 2041 | |
Version | 1.0 | |
Bundle ID | com.automattic.gravatar-sdk-demo-uikit.prototype-build | |
Commit | 43091a0 | |
App Center Build | Gravatar SDK Demo - UIKit #564 |
Sources/GravatarUI/SwiftUI/AvatarPicker/AvatarPickerViewModel.swift
Outdated
Show resolved
Hide resolved
This looks like a reasonable workaround to me. At first blush, at least, this seems like something the backend should handle better. It seems strange that the backend lazily creates the profile when |
I thought it was because the |
Discussed with @jom, the |
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.
I have reproduced the issue and tested this solution.
I think a small fix for this backend issue is good to have. In my experience, though it's not a blocker for the user, it might appear odd for some, but probably many won't really pay attention to it.
Still it seems like a malfunction by our SDK so I'd vote for merging this fix.
This is how the issue looks like:
CleanShot.2025-01-20.at.12.33.14.mp4
![](https://private-user-images.githubusercontent.com/9772967/404869711-947aece5-31a5-44e3-833b-1a50cbf7dc92.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODk5NzAsIm5iZiI6MTczOTM4OTY3MCwicGF0aCI6Ii85NzcyOTY3LzQwNDg2OTcxMS05NDdhZWNlNS0zMWE1LTQ0ZTMtODMzYi0xYTUwY2JmN2RjOTIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMTk0NzUwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjRkMjczYWYwZTdmM2FjMzQyMGUzZmViNzY0MzE1OGFjYTFiNzA4ZGY1ZmMyNzMzOTQwYTE3MzEzZDlhYzhhNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.HOVsby2DLu9aSDUc_IRaXXMRzelRdeHeyMHZ4mzjyMU)
I also tested setting an image to see if the whole Profile card updates (magically). If it were the case, this fix wouldn't be needed IMO, but it does not refresh, only the avatar.
CleanShot.2025-01-20.at.12.39.57.mp4
Finally, while testing this branch, the Profile card loads as expected 🎉
CleanShot.2025-01-20.at.12.59.40-converted-converted.mp4
I saw first a small blink where the card shows the placeholder labels:
To then finally load the user info:
But most importantly, what I noticed is that the avatar from the Profile won't change after selecting an avatar (shown in the last video).
I have two thoughts about this:
-
If the Profile Card loads the placeholder text in the labels instead of keeping the gray loading state, maybe is much less obvious that it is an error, and we can keep it this way.
-
The avatar selection no showing on the Profile card is a blocker to merge this PR. But I'd vote for a simpler solution if possible which I mentioned in the previous point.
I noticed the same issue and I think fixed it by increasing the delay here in the release branch.
|
This reverts commit 26d73c6.
…swift Co-authored-by: Andrew Montgomery <[email protected]>
fb8d840
to
343d1b0
Compare
I made this PR #644 to remove the workaround I mentioned here #615 (comment) |
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.
The problem mentioned before seems to be resolved:
CleanShot.2025-01-22.at.11.59.08.mp4
The user profile is loaded on the first opening of the quick editor, and the avatar image updates as expected 🎉
Closes #612
Description
Fixes the issue described in #612
This is to avoid the initial blank state of the profile view that a new user sees. When a user creates an account via
WordPress.com
they don't have a Gravatar profile yet so the Quick Editor shows blank fields initially. The Gravatar profile is created at the backend during the first avatars fetching, but we never refresh the client so the profile view remains blank and shows grey placeholders. This PR fixes that issue.The issue is not too bad so I was on the fence of fixing/leaving it. Doing this only because I believe that the solution is not risky, it only adds an extra profile fetch call. But let me know if you think otherwise.
Testing Steps
Easiest way to test is using the Jetpack app
Check out WordPress-iOS
trunk
Point the Gravatar dependency to this branch' latest commit
Run the Jetpack app
You can use a temp inbox like www.emailondeck.com to create an email
Logout and create a new user
Go to your inbox, verify the email (open the email verification link in incognito mode to isolate from your existing .com session otherwise it may not work)
Go to Me > My Profile > Add profile photo
Observe: The profile view does NOT show grey placeholder fields, instead, it shows the user's username and "View profile ->" button.