Skip to content

Commit

Permalink
Appview: fix uri used to place threadgate in getPostThread response (b…
Browse files Browse the repository at this point in the history
…luesky-social#2741)

appview: fix uri used to place threadgate in getPostThread response
  • Loading branch information
devinivy authored Aug 23, 2024
1 parent 5af9b82 commit ec2e426
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/bsky/src/api/app/bsky/feed/getPostThread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ const presentation = (
})
if (isNotFoundPost(thread)) {
// @TODO technically this could be returned as a NotFoundPost based on lexicon
throw new InvalidRequestError(`Post not found: ${params.uri}`, 'NotFound')
throw new InvalidRequestError(
`Post not found: ${skeleton.anchor}`,
'NotFound',
)
}
const rootUri =
hydration.posts?.get(params.uri)?.record.reply?.root.uri ?? params.uri
hydration.posts?.get(skeleton.anchor)?.record.reply?.root.uri ??
skeleton.anchor
const threadgate = ctx.views.threadgate(
postUriToThreadgateUri(rootUri),
hydration,
Expand Down

0 comments on commit ec2e426

Please sign in to comment.