From feb994a1783a0def882c4b28387023509f91f426 Mon Sep 17 00:00:00 2001 From: devin ivy Date: Fri, 29 Sep 2023 14:02:48 -0400 Subject: [PATCH] Fix cursor on with-friends to hit index (#1692) * fix cursor on with-friends to hit index * build * remove build --- packages/bsky/src/feed-gen/with-friends.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bsky/src/feed-gen/with-friends.ts b/packages/bsky/src/feed-gen/with-friends.ts index 98f784102a5..0fd8f31c48e 100644 --- a/packages/bsky/src/feed-gen/with-friends.ts +++ b/packages/bsky/src/feed-gen/with-friends.ts @@ -15,7 +15,7 @@ const handler: AlgoHandler = async ( const { ref } = db.db.dynamic - const keyset = new FeedKeyset(ref('post.indexedAt'), ref('post.cid')) + const keyset = new FeedKeyset(ref('post.sortAt'), ref('post.cid')) const sortFrom = keyset.unpack(cursor)?.primary let postsQb = feedService @@ -24,7 +24,7 @@ const handler: AlgoHandler = async ( .innerJoin('post_agg', 'post_agg.uri', 'post.uri') .where('post_agg.likeCount', '>=', 5) .where('follow.creator', '=', requester) - .where('post.indexedAt', '>', getFeedDateThreshold(sortFrom)) + .where('post.sortAt', '>', getFeedDateThreshold(sortFrom)) postsQb = paginate(postsQb, { limit, cursor, keyset, tryIndex: true })