Closed
Conversation
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
|
@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, | ||
| }, | ||
| }, | ||
| } | ||
| : {}), |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
fetchOpenGraphData,createExternalEmbed,extractFirstUrlfunctions)postmethod 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:
getAgentanduploadMediaForPostmethods were inlined or removed for clarity, and agent initialization is now handled directly in thepostmethod. [1] [2]generateAuthUrlmethod 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.