snarfed / bridgy-fed

🌉 A bridge between decentralized social network protocols
https://fed.brid.gy/
Creative Commons Zero v1.0 Universal
485 stars 28 forks source link

Post don't get linked on Sharkey while truncated #1155

Closed AtiusAmy closed 4 days ago

AtiusAmy commented 5 days ago

On Sharkey, posts seem to not get linked on Sharkey while truncated:

https://bsky.app/profile/atiusamy.social.atiusamy.com.ap.brid.gy/post/3kvst7puqgvc2

However, my boyfriend (on GoToSocial) have linked to the full version

https://bsky.app/profile/winsdominoes.fedi.winscloud.net.ap.brid.gy/post/3kvslnmqo7br2

snarfed commented 4 days ago

Interesting! Thanks for reporting. Looks like this is because, surprisingly, Sharkey AS2 objects don't have the url field, which is the human-readable URL to the post. For example, here's your Note object https://social.atiusamy.com/notes/9uz3qie07fdf0aqr :

{
  "@context": "...",
  "type": "Note",
  "id": "https://social.atiusamy.com/notes/9uz3qie07fdf0aqr",
  "attributedTo": "https://social.atiusamy.com/users/9p9rv1xudh4b0001",
  "content": "<p>I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post. I am testing a funny and long post.</p>",
  "published": "2024-06-26T07:52:18.840Z",
  "to": ["https://www.w3.org/ns/activitystreams#Public"],
  "cc": ["https://social.atiusamy.com/users/9p9rv1xudh4b0001/followers"],
  "inReplyTo": null,
  "attachment": [],
  "sensitive": false,
  "tag": []
}

Some fediverse servers do conneg and serve HTML to id URLs, but not all - Threads is one example - and AP doesn't require it. So, if url isn't available, I could link to id, but I'm reluctant to.

Having said that, omitting url is rare, so maybe it's worth falling back to id in those cases. 🤷

snarfed commented 4 days ago

Falling back to id in these cases seems reasonable. We may send some people to ugly AS2 JSON, but that's probably an acceptable cost. Done!

AtiusAmy commented 4 days ago

Awesome!