Skip to content

Feature/bluesky link previews#1206

Closed
kfuras wants to merge 2 commits intogitroomhq:mainfrom
kfuras:feature/bluesky-link-previews
Closed

Feature/bluesky link previews#1206
kfuras wants to merge 2 commits intogitroomhq:mainfrom
kfuras:feature/bluesky-link-previews

Conversation

@kfuras
Copy link

@kfuras kfuras commented Feb 4, 2026

This pull request introduces significant improvements to the Bluesky social integration, primarily by enhancing how posts with URLs are handled and refactoring the post and comment logic for better maintainability and richer content embedding. The main highlights are the addition of Open Graph (OG) card support for posts containing URLs, a refactored posting workflow to support threads and replies, and the removal of some outdated or redundant code.

Enhancements to link embedding and post workflow:

  • Added Open Graph card support: Posts without media but containing a URL now automatically generate an external embed card using OG metadata (title, description, image), providing richer previews in Bluesky posts. (fetchOpenGraphData, createExternalEmbed, extractFirstUrl functions)
  • Refactored post creation logic: The post method now loops through all post details, handling media, OG card embeds, and thread/reply relationships in a unified workflow. This enables multi-post threads and improved reply handling. [1] [2] [3] [4]

Codebase and interface improvements:

  • Removed obsolete methods and simplified agent initialization: The getAgent and uploadMediaForPost methods were inlined or removed for clarity, and agent initialization is now handled directly in the post method. [1] [2]
  • Improved error handling and robustness: Added error handling for OG data fetching and thumbnail upload, ensuring the post process continues even if some metadata cannot be retrieved.
  • Minor interface tweaks: Removed an outdated tooltip about two-factor authentication and fixed the generateAuthUrl method to return an empty URL. [1] [2]

These changes collectively make the Bluesky provider more robust, user-friendly, and capable of producing richer, more engaging posts.

HilaryTorn and others added 2 commits November 26, 2025 19:38
Adds support for app.bsky.embed.external when posting to Bluesky with URLs
but no media attachments. Fetches Open Graph metadata (title, description,
thumbnail) and creates rich link preview cards.

Closes gitroomhq#667
@vercel
Copy link

vercel bot commented Feb 4, 2026

@kfuras is attempting to deploy a commit to the Listinai Team on Vercel.

A member of the Team first needs to authorize it.

Comment on lines +461 to +467
parent: {
uri: loadUri,
cid: loadCid,
},
},
}
: {}),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: In Bluesky threads with more than two posts, the reply.root and reply.parent references are swapped, causing incorrect threading.
Severity: HIGH

Suggested Fix

Swap the values assigned to the root and parent properties within the reply object. The root property should use loadUri and loadCid to reference the first post. The parent property should use replyUri and replyCid to reference the immediately preceding post.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location:
libraries/nestjs-libraries/src/integrations/social/bluesky.provider.ts#L461-L467

Potential issue: When creating a Bluesky thread with three or more posts, the reply
references are incorrectly assigned starting from the third post. The `reply.root`
object, which should consistently point to the first post of the thread, is instead
assigned the URI and CID of the immediately preceding post. Conversely, the
`reply.parent` object, which should point to the preceding post, is assigned the
references of the first post. This swap will cause Bluesky to either reject the posts or
display the thread with an incorrect structure.

Did we get this right? 👍 / 👎 to inform future reviews.

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

Successfully merging this pull request may close these issues.

2 participants