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

Fediverse => Bluesky: auto-generate embeds (with thumbnail images) for links? #1411

Closed
EdlReg opened this issue Oct 23, 2024 · 26 comments
Closed
Labels
compat Protocol differences that need special handling. now

Comments

@EdlReg
Copy link

EdlReg commented Oct 23, 2024

I do not know if this is a general problem between platforms or if it is strictly an issue between Mastodon -> Bluesky, but whenever I post an article (or other external link) on Mastodon the thumbnail doesn't show up on Bluesky. You can see the link and click on it, but no thumbnail.
Would be great if this could be fixed.

@Tamschi Tamschi added the compat Protocol differences that need special handling. label Oct 23, 2024
@Tamschi
Copy link
Collaborator

Tamschi commented Oct 23, 2024

This happens because in ActivityPub (Mastodon) link previews are generated by the receiver, but in Bluesky they are stored by the sender as part of the post itself. Bridgy Fed already handles this for web posts it seems (#1192).

Relevant Bluesky lexicons:

@EdlReg
Copy link
Author

EdlReg commented Oct 23, 2024

Ok, my instance is Mastodon.nu if that is of any importance.

@Tamschi
Copy link
Collaborator

Tamschi commented Oct 23, 2024

It's mainly the software and version that matters, as long as posts go through at all.

(The current Mastodon v4.3.1, in this case.)

@snarfed snarfed changed the title Article thumbnails not showing Fediverse => Bluesky: auto-generate embeds (with thumbnail images) for links Oct 23, 2024
@snarfed snarfed changed the title Fediverse => Bluesky: auto-generate embeds (with thumbnail images) for links Fediverse => Bluesky: auto-generate embeds (with thumbnail images) for links? Oct 23, 2024
@snarfed
Copy link
Owner

snarfed commented Oct 23, 2024

This is an interesting one! @Tamschi is broadly right: Bluesky/ATProto link previews (including thumbnail images) are explicit metadata in post objects. ActivityStreams 2 post objects can have similar link preview metadata, eg in the attachment field, but fediverse clients and servers like Mastodon often generate them from the first link in the post instead. When they get a post with an attachment, they halfway honor it and render it similarly, but usually without an image, so it looks like a second class citizen.

Take https://indieweb.social/users/snarfed/statuses/112582713947140513 as an example. I authored it inside Mastodon, and included a single URL in the text. Mastodon renders a link preview embed for that URL, in both the source instance and remote instances, but it federates it as an AS2 Note with no attachment value. The user-visible link preview is handled entirely outside AP.

image

I haven't done a comprehensive survey, but afaik at least some other popular fediverse servers, if not most, do the same thing.

So, the common case is that fediverse link previews are a non-standard heuristic, and I'm reluctant to bake that kind of thing into Bridgy Fed. I get that it might still be the right thing to do for UX though! So I'm torn.

(I do indeed do this for web => Bluesky, but that situation is very different, since the source post is a single specific web page.)

@snarfed
Copy link
Owner

snarfed commented Oct 24, 2024

More background on how fediverse servers, particularly Mastodon, prefer to generate their own link previews and don't really want (or trust) them in federated attachments: #958

@EdlReg
Copy link
Author

EdlReg commented Nov 10, 2024

Any progress on this issue? I think it should be a priority, since many Bluesky users are (understandably) hesitant to click on a shortened URL. See example below.
Skärmavbild 2024-11-10 kl  12 16 01

@snarfed
Copy link
Owner

snarfed commented Nov 10, 2024

No progress yet, sorry.

First step would be to decide that we want to apply this non-standard heuristic described above, specifically that if there are link(s) in the text and no explicit preview, we generate one automatically based on the first link. I don't love that, but I guess I'm ok with it.

After that, it's just the implementation work. PRs are welcome!

@EdlReg
Copy link
Author

EdlReg commented Nov 12, 2024

I can see why you're hesitant/reluctant, but as long as most fediverse clients and servers like Mastodon continue to generate previews from the first link in the post, it sounds like a good fix.
Unfortunately, I'm not a coder myself, but I'm happy to give feedback on design proposals, if that is of any help.

@Steviemac1
Copy link

Sorry, I hadn't seen/connected Flipboard URLs not generating an image with this. If I may show my naivety and ignorance and ask a possibly daft question. Can major platforms like Flipboard be persuaded to do anything different to make it work, or is that the wrong end to tackle the issue?

@Tamschi
Copy link
Collaborator

Tamschi commented Nov 20, 2024

Interestingly, there seems to be ongoing work on Mastodon's end to federate link previews: https://www.theregister.com/2024/05/06/mastodon_delays_fix_ddos/

The discussion on that is here: mastodon/mastodon#23662

If they go ahead with standardising a federated link preview system, even if it's just a cached version without full trust, then that's likely something that Bridgy Fed could translate back and forth between the networks.

@snarfed
Copy link
Owner

snarfed commented Nov 20, 2024

Can major platforms like Flipboard be persuaded to do anything different to make it work, or is that the wrong end to tackle the issue?

Good question! I talk with people at Flipboard and many of the other big platforms pretty regularly. There are a number of options here, discussed above, but the conclusion right now is probably just to generate the previews ourselves.

@Steviemac1
Copy link

Thanks, just to add. I now see someone has noted that the bridged posts from Flipboard look like a bot and has added to a warning list. Small scale, but could be indicative of how viewers see the posts.

@Steviemac1
Copy link

There has been a slight change. More of a text preview now appears on posts from Flipboard, but no image as yet.

@snarfed
Copy link
Owner

snarfed commented Nov 29, 2024

Good eye! Yup, I shipped a first pass at this, it works, but doesn't include images yet. Working on those.

@Steviemac1
Copy link

Sounds like a plan! Thanks.

snarfed added a commit to snarfed/granary that referenced this issue Nov 30, 2024
@EmilJacobs
Copy link

I see previews now 👀

@Steviemac1
Copy link

Me too, thank you for the fix. It looks so much better now. 🙌

@snarfed
Copy link
Owner

snarfed commented Nov 30, 2024

Rolling this back temporarily due to #1575, sorry. It'll be back soon!

@popet-master
Copy link

also, you'll want to mind the hashtag (induced) links in the bridged posts. I had a post from piaille.fr Masto that had a hashtag first thing, and it displayed on Bsky with the preview of piaille.fr 😁

snarfed added a commit that referenced this issue Dec 1, 2024
@snarfed
Copy link
Owner

snarfed commented Dec 1, 2024

Updated and deployed again. Example:

@chaperon1234
Copy link

chaperon1234 commented Dec 3, 2024

My bluesky account is
https://bsky.app/profile/chaperon.fedibird.com.ap.brid.gy
but these toot is not reflected in blue sky.

https://fedibird.com/@chaperon/113585855054825034
https://fedibird.com/@chaperon/113581312460836009

There are several other posts that have not been reflected in blueSky since the day the link preview feature of this issue was implemented.
It appears to be mainly Twitter and Bluesky links, but there are a few other posts that are not being reflected.
Do you know the cause?

@EdlReg
Copy link
Author

EdlReg commented Dec 4, 2024

Working great for me, toots with external links showing up with previews on Bluesky (my Mastodon account is on the instance Mastodon.nu, btw). Thank you for fixing this, @snarfed !

Haven't tried links to X or Bluesky, but for me that's of less importance than news sites etc.

@EmilJacobs
Copy link

Just a short addon to this: it works well for short posts that are bridged, but for posts with more than 300 characters, it doesn't. Could this still be fixed?

@snarfed
Copy link
Owner

snarfed commented Dec 4, 2024

@EmilJacobs right now, if a post is longer than 300 chars and we have to truncate it, we prioritize the link to the original post.

@popet-master
Copy link

on some posts, it seems that the image size in the mirrored post is not set as per the original, see e.g.
https://bsky.app/profile/politipet.piaille.fr.ap.brid.gy/post/3lcl3tpopwai2
vs
https://piaille.fr/@politipet/113601175324204315

@snarfed
Copy link
Owner

snarfed commented Dec 6, 2024

@popet-master yes! that's #1571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compat Protocol differences that need special handling. now
Projects
None yet
Development

No branches or pull requests

7 participants