snarfed / bridgy

πŸ“£ Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
https://brid.gy
Creative Commons Zero v1.0 Universal
703 stars 52 forks source link

Bluesky: include embeds in original post discovery #1611

Closed snarfed closed 8 months ago

snarfed commented 8 months ago

Looks like OPD is currently missing original post links that show up in an embed but not in post text. We should look in embeds too! Example: https://bsky.app/profile/snarfed.org/post/3kearseq3532n

{
  "uri": "at://did:plc:fdme4gb7mu7zrie7peay7tst/app.bsky.feed.post/3kearseq3532n",
  "cid": "bafyreigast6fvdbuyxe3hdgeyou6pn2pxjcfgggxxvb3scdf5z564yjm44",
  "value": {
    "$type": "app.bsky.feed.post",
    "text": "Hot on the heels of last week's Bridgy Fed progress, more to report this week: first pass at Bluesky support is feature complete! All basic interactions - user discovery, following, posts, replies, likes, reposts - are working, both directions. πŸŽ‰",
    "embed": {
      "$type": "app.bsky.embed.external",
      "external": {
        "uri": "https://snarfed.org/2023-11-15_bridgy-fed-status-update-9",
        "thumb": {
          "$type": "blob",
          "ref": {
            "$link": "bafkreicxbomf3uvbq5xogp3wozcureg5poh44zhzhwhjdy5vhcp5rvuk4u"
          },
          "mimeType": "image/jpeg",
          "size": 665507
        },
        "title": "Bridgy Fed status update",
        "description": "Another brief Bridgy Fed progress report: first pass at Bluesky support is feature complete! All basic interactions – user discovery, following, posts, replies, likes, reposts – are wor…"
      }
    },
    "langs": ["en"],
    "createdAt": "2023-11-15T19:30:47.318Z"
  }
}
snarfed commented 8 months ago

Surprisingly easy fix ^ ...but oddly it only worked for replies, not likes or reposts. Hrm.

snarfed commented 8 months ago

I'm guessing the problem here is that likes and replies don't have the full original post object, and we're not fetching it like we need to before we do OPD. Hrm.

snarfed commented 8 months ago

Actually I think this from this poll log is the smoking gun:

I 2023-11-17 20:53:37.859508+00:00 Demoting original post links because user tag:bsky.app,2013:did:plc:2jwys3khk3vezo4s7dodvrno did:plc:2jwys3khk3vezo4s7dodvrno doesn't match author did:plc:2jwys3khk3vezo4s7dodvrno marcuslindblom.com

snarfed commented 8 months ago

Yup, looks like that did it. @marcuslindblom this fix didn't backfill your missing like from before, but hopefully they should work going forward. Thanks again for the reports, all!

marcuslindblom commented 8 months ago

Awesome πŸ‘

jacklorusso commented 8 months ago

This worked for me, thank you so much! Likes and replies showing up perfectly on my site now, cheers