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

BIO and Avatar #211

Closed
marc0janssen opened this issue Dec 7, 2022 · 39 comments
Closed

BIO and Avatar #211

marc0janssen opened this issue Dec 7, 2022 · 39 comments

Comments

@marc0janssen
Copy link

Hi There,

Question: Sinds this a beta software, are the BIO en AVATAR "sync" not just implemented?

I don't see a BIO and the avatar is empty when looking up the account on mastodon.

@pfefferle
Copy link
Member

The plugin uses the author description as bio and the gravatar as avatar.

@marc0janssen
Copy link
Author

Oh ok... mine are still empty...
I have set up a gravatar and a small BIO in place..

I might have to wait some more.

@marc0janssen
Copy link
Author

Waited 6 hours or so... still no avatar and bio from Wordpress activatypub... any hints?

@mediaformat
Copy link
Collaborator

@marc0janssen Mastodon has quite aggressive caching, and could keep this version for a long time, however Publishing a post to your Mastodon followers, should make the server re-fetch the WP profile.

@marc0janssen
Copy link
Author

marc0janssen commented Dec 8, 2022

Thank. I tested this. But no result yet. Also hashtags are no coming through.

@marc0janssen
Copy link
Author

The BIO text is updated. SO this seems to work.

Hashtages and avatar are not coming through.

Do you have a hint or so?

@mediaformat
Copy link
Collaborator

mediaformat commented Dec 12, 2022

I wonder if it's because of the ports, if you lookup your webfinger you will see domain:443/

Edit: I just looked your profile up from a different instance, and your avatar came through. But the posts are not fetchable at the moment.

@marc0janssen
Copy link
Author

This is the output.

`Request Log

21:09:38 Looking up WebFinger data for acct:marco@theattic.mjanssen.nl
21:09:38 GET https://theattic.mjanssen.nl/.well-known/webfinger?resource=acct%3Amarco%40theattic.mjanssen.nl
JSON Resource Descriptor (JRD)

{
"subject": "acct:marco@theattic.mjanssen.nl",
"aliases": [
"acct:marco@theattic.mjanssen.nl",
"https://theattic.mjanssen.nl:443/author/marco/",
"mailto:marco@mjanssen.nl"
],
"links": [
{
"rel": "http://webfinger.net/rel/profile-page",
"type": "text/html",
"href": "https://theattic.mjanssen.nl:443/author/marco/"
},
{
"rel": "http://webfinger.net/rel/avatar",
"href": "https://secure.gravatar.com/avatar/df726990448c149512cd5ced0f5718dd?s=96&d=mm&r=g"
},
{
"rel": "http://webfinger.net/rel/profile-page",
"type": "text/html",
"href": "https://theattic.mjanssen.nl:443"
},
{
"rel": "self",
"type": "application/activity+json",
"href": "https://theattic.mjanssen.nl:443/author/marco/"
},
{
"rel": "http://nodeinfo.diaspora.software/ns/schema/2.0",
"href": "https://theattic.mjanssen.nl:443/wp-json/nodeinfo/2.0"
},
{
"rel": "http://nodeinfo.diaspora.software/ns/schema/1.1",
"href": "https://theattic.mjanssen.nl:443/wp-json/nodeinfo/1.1"
},
{
"rel": "http://nodeinfo.diaspora.software/ns/schema/1.0",
"href": "https://theattic.mjanssen.nl:443/wp-json/nodeinfo/1.0"
},
{
"rel": "https://feneas.org/ns/serviceinfo",
"type": "application/ld+json",
"href": "https://theattic.mjanssen.nl:443/wp-json/serviceinfo/1.0",
"properties": {
"https://feneas.org/ns/serviceinfo#software.name": "The Attic"
}
}
]
}`

@mediaformat
Copy link
Collaborator

When I tried fetching the profile https://theattic.mjanssen.nl:443/author/marco/ (with ap accept headers) it was returning html and not json

@marc0janssen
Copy link
Author

marc0janssen commented Dec 13, 2022 via email

@marc0janssen
Copy link
Author

marc0janssen commented Dec 13, 2022

Hi Django,

Found out the following

Mastodon.social has a agressive caching (I guess). my activity pub data from Wordpress (avatar that is, bio is fine) is not updated. When I check it on mstdn.social/mastadon.nl/systems.discuss (and I think any other server) the data is just fine. everything is fetched and updated.

I don't know if you know micro.blog? They have activitypub also activated for their site. On mastodon.social their data is also not coming through. On mstdn.social/mastadon.nl/systems.discuss (and I think any other server) their data is coming through.

I guess this is a mastodon.social problem.

My activitypub-plugin in wordpress sometimes just seems to stop working (I noticed this in sitehealth in tools). I get a critical error. There is nothing to be done at that point to fix it (for me).

What I do is kill and clear my docker containers. Run docker compose to get containers all up and running again. Install my backup-plugin by hand. Restore the last backup from last night. And all is just fine.... I have no idea what causes this. I only know how to get this work around working. This not pretty and nice, but it works for the time being.

Maybe you can point out some stuff I can look at when the problem is occurring , before I restore the backup again,

@marc0janssen
Copy link
Author

Error again:

Author URL is not accessible
ActivityPub
Your author URL https://theattic.mjanssen.nl:443/author/marco/ does not return valid JSON for application/activity+json. Please check if your hosting supports alternate Accept headers.

Gets annoying now.

@marc0janssen
Copy link
Author

CleanShot 2022-12-13 at 18 40 25@2x

@marc0janssen
Copy link
Author

When I only restore all the plugins from the backup, all the problems are gone again...

Is the activity pub plugin corrupting itself ???

@mediaformat
Copy link
Collaborator

It looks like you are using WP Fast Cache plugin. Caching plugins are known to interfere with the activitypub plugin!

@marc0janssen
Copy link
Author

(Marco runs to kill that plugin)

@marc0janssen
Copy link
Author

(how could you tell?)

@mediaformat
Copy link
Collaborator

mediaformat commented Dec 13, 2022

I still had an article page fetched in Postman, looking at the source, I noticed: <script src='//theattic.mjanssen.nl:443/wp-content/cache/wpfc-minified/7c2xr9sz/fr4hg.js' type="text/javascript"> and cache/wpfc gave it away ;-)

@marc0janssen
Copy link
Author

Colombo you are.... I will check the next few day if it stays stable.... (thanks for all the help)

@gbraad
Copy link

gbraad commented Dec 29, 2022

akirk/friends#139

It seems favicon.ico is stored. Is this expected?

@pfefferle
Copy link
Member

Is this still an issue?

@marc0janssen
Copy link
Author

marc0janssen commented Feb 2, 2023 via email

@pfefferle
Copy link
Member

Is this still an issue?

@marc0janssen
Copy link
Author

marc0janssen commented May 22, 2023 via email

@pfefferle
Copy link
Member

What platform do you use? Mastodon.social, seems to use the correct image:

Bildschirmfoto 2023-05-22 um 15 33 37

@marc0janssen
Copy link
Author

marc0janssen commented May 25, 2023 via email

@YourAutisticLife
Copy link

I'm still having issues with my avatar refresh.

I did set an avatar initially, and it transferred to my fediverse profile just fine.

However, I've since changed my avatar on WordPress (I wanted to distinguish it from my Mastodon account), but I'm still not seeing the change in my profile on the fediverse.

This is my WordPress handle: @yourautisticlife@www.yourautisticlife.com

I've checked it both from my own instance: mast.yourautisticlife.com
And from universeodon: https://universeodon.com/@yourautisticlife@www.yourautisticlife.com

Not sure if I should open a new issue...

@pfefferle
Copy link
Member

Mastodon caches the avatar and there is no possibility to invalidate that cache. Have you posted a new blog-post since then? I may have heard that mastodon updates the cache when there is new activity.

@YourAutisticLife
Copy link

Yes, yes, yes. I've posted a ton of posts. I thought about the cache.

@camielschoonens
Copy link

If you are running your own Mastodon server you can force an account refresh with the following command.

tootctl accounts refresh

If you don’t have such access there is nothing more you can do but wait until the server refreshes the account at a certain interval.

@YourAutisticLife
Copy link

@camielschoonens Doing the tootctl command worked to refresh the information on my server. However, it is still not refreshed anywhere else. I checked with universeodon.com again. Still the old profile. I have a few ideas to test.

@YourAutisticLife
Copy link

Actually... I'm baffled now because what mast.yourautisticlife.com shows is very different than what universeodon.com shows.

This is a screenshot of my profile seen from mast.yourautisticlife.com (my Mastodon instance). There's no profile text. This is incorrect. The avatar is correct.

Screenshot from 2023-08-23 11-43-26

This screenshot is from universeodon.com. The profile text is correct. The avatar is wrong. There are also differences in the number of posts and the number of followers.

Screenshot from 2023-08-23 11-43-40

The text of my profile was set ages ago. I changed the avatar a few weeks ago. This is all extremely confusing.

@mediaformat
Copy link
Collaborator

do you have any caching plugins on your own website?

@YourAutisticLife
Copy link

@mediaformat No caching plugins.

The problem is still present as of 1.0.0:

  • I used tootctl to flush the cache on mast.yourautisticlife.com. The profile picture was changed. I notice now that the profile text is now synchronized, but I don't know what did it. (This is contrary to the screenshot above.)

  • I look at the profile with universeodon.com, and it still shows the old picture.

@pfefferle
Copy link
Member

I am no mastodon expert, but the cache might be configurable by the network admin?!?

@andrigamerita
Copy link

To anyone struggling here, I've found a solution, probably will make a pull request for it. My thought was that other instances didn't update their profile picture cache because when changing the profile picture on WordPress (which means, changing it on Gravatar), the URL of the picture stays the same. I don't know if this is standard or not, but in practice instances usually won't try to check if the content that a media URL points to has changed from time to time, but only refresh the media if the URL changes too. So, my solution is to simply make the ActivityPub plugin append something to the URL that doesn't break it, but makes it change. What I did is edit wp-content/plugins/activitypub/includes/model/class-user.php, and inside the function get_icon(), inside the return block, change the 'url' => $icon, to 'url' => $icon . '#t=' . date('Ydm', time()),, and in practice this makes it so the URL always has the current day string at the end, which means the URL is renewed everyday, and thus checked frequently enough by other instances. Use another time string instead of Ydm if you want to maybe update the URL every hour (so, Ydmh), but keep in mind that Mastodon still has aggressive caching, it could take 1 or 2 days for the pfp changes to be reflected, while other platforms (eg. Misskey) will usually try to update the image as soon as the URL changes.

andrigamerita added a commit to andrigamerita/wordpress-activitypub that referenced this issue Dec 11, 2023
As complained in Automattic#211, when a user updates their Gravatar profile picture, the change fails to be reflected on many ActivityPub instances that already know the user. This is usually because, when changing the Gravatar image, since the URL remains the same, instances won't try to redownload the data, and thus their media cache isn't updated. From my testing, simply adding a changing dummy parameter to the URL hash returned in the user's JSON is a change that is noticed by other instances, that will try to redownload the image from Gravatar (my experience is minutes for Misskey, and ~1 day for Mastodon). A decent solution to this problem is thus to add the current day string to the URL hash ($icon as returned by get_icon() as 'url'), in the format Ymd, which will result in the URL changing every day, which should be enough for any user, while at the same time avoiding overloading instances which try to do frequent refreshes. (See Automattic#211 (comment))
@YourAutisticLife
Copy link

I should mention that I'm no longer experiencing this problem.

I've been wondering if WordPress needs some sort of profile edit to flush the information out, but I've never tested the idea.

(Before someone points out that it is obvious that a profile edit is needed, no it is not. Changing the Gravatar will change the profile picture shown in WordPress, but it won't automatically propagate to the fediverse.)

@iamwebrocker
Copy link
Contributor

Hm, just thinking out loud here, but Is there a way to modify the timestamp idea to the date/time the avatar has changed? Or maybe add that cachbusting parameter with the first 8 digits of the md5 hash of the actual image?
If every AP enabled wordpress "fakes" a daily change to the profile image, and thus forces the instances to recapture and refresh their caches for no reason most times, isn't that a waste of resources (thinking of the scale if this is in every WP instance with the AP plugin active)

@pfefferle
Copy link
Member

Version 2.0.0 has an update Activity on profile changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants