-
Notifications
You must be signed in to change notification settings - Fork 74
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
Broken comment avatars #697
Comments
Related: #568. That issue was closed because there is a follower update cron. (I noticed the issue in the context of followers' avatars.) Not sure if a "commenter updater" is feasible. Storing them locally is what I do now, for a default duration of one month. Which people may not like, because it won't immediately reflect changes made on their end. (In fact, I think I may never update old comments. I'm not too sure anymore.) And so on. Interested to hear about a better solution. |
Is there a workaround to manually edit/update the avatar? |
The URL, I believe, is stored in a custom meta field (or custom post field). If you know a bit of SQL, it could be updated that way (but it is rather tedious). There are other ways, but nothing easy. (I personally use a custom add-on plugin that fetches the avatar and stores it locally, and overwrites the aforementioned custom field with the "local" URL.) I was initially also thinking of an extra field on the "Edit Comment screen" where one could view and possibly even edit the URL, but I'm afraid future versions of the plugin will make it harder to even access this screen (for "Fediverse comments," at least, the reasoning being that site admins shouldn't be able to just go and change other people's [remote] replies). |
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
I think this is still an issue. The "solution" would be to locally save avatars (I myself, through an add-on plugin, save them while the URL is being stored, and use a Then if another comment comes in by the same person, the plugin could check whether their avatar got updated (I simply check if the cached version is older than a month and always overwrite it if that's the case) and overwrite it if needed. Something similar could be done for follower avatars. (I haven't been able to come up with a way to locally save those, as there's no hook [I think] I can call before storing the avatar URL. But it's less of an issue because they should get updated automatically in the background.) |
@janboddez what plugin do you use for this? |
I personally (and I know this isn't for everyone, but maybe other people could draw inspiration from it) use https://github.com/janboddez/addon-for-activitypub/ in combination with https://wordpress.org/plugins/indieblocks/. If you were to install both plugins and enabled "Addon for ActivityPub's" "Cache Avatars" setting, comment avatars should get saved locally going forward (all other settings, including all of IndieBlocks' settings, can be disabled). ("IndieBlocks" obviously does a lot more, or can do a lot more, so I understand this isn't, like, ideal. I guess I could always try and port over only its image caching function to "Addon for ActivityPub" in order to no longer also need "IndieBlocks.") |
Update: IndieBlocks is no longer required. Just https://github.com/janboddez/addon-for-activitypub/ should allow for locally caching comment avatars. (If WordPress has "direct filesystem access," I may one day expand this.) Feel free to give it a try. |
Thanks! Installed both 🫡 |
Quick summary
Avatars on activitypub comments become broken after the URL for the user's avatar changes on Mastodon's side.
Specifically, the first comment on this post.
The avatar used to load before, but now it's broken.
Steps to reproduce
I'm not sure how to give instructions to reproduce this, since it requires that someone else comments on your site and the URI for their avatar changes.
What you expected to happen
Every comment has a functional avatar. In the absence of an avatar, a fallback placeholder avatar is used.
What actually happened
When the comment author's avatar is not reachable, it results in a broken image on your site.
Impact
One
Available workarounds?
No but the platform is still usable
Logs or notes
Looking at the HTML, the comment by my friend uses this URL for the avatar:
https://sunbeam.city/system/accounts/avatars/000/038/480/original/a12605bee7e9406e.jpg
When I go to their profile on Mastodon and click inspect element on their avatar, I see that the actual URI for their avatar is
https://sunbeam.city/system/accounts/avatars/000/038/480/original/73da25f84ad489a3.jpg
The text was updated successfully, but these errors were encountered: