From d07229155911c87d2c2370b67f1b53954ed3ced2 Mon Sep 17 00:00:00 2001 From: Alex Benzer Date: Thu, 9 Jul 2026 21:37:38 -0700 Subject: [PATCH] Only expose known-likers experiment when there's something to show Fetch the likers sample for everyone signed in, then check the feature gate only if the viewer follows one of the likers. This keeps people who'd see no difference out of the test. Note: this means app.bsky.feed.getLikes will be called on every thread page view for signed-in users for posts with at least 1 like --- .../PostThread/components/LikesStat.tsx | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/screens/PostThread/components/LikesStat.tsx b/src/screens/PostThread/components/LikesStat.tsx index fa5bb86ccb..22e3fa4a32 100644 --- a/src/screens/PostThread/components/LikesStat.tsx +++ b/src/screens/PostThread/components/LikesStat.tsx @@ -39,16 +39,8 @@ export function LikesStat({post}: {post: AppBskyFeedDefs.PostView}) { const ax = useAnalytics() const likeCount = post.likeCount ?? 0 - /* - * Check the gate last: GrowthBook logs an exposure per evaluation, so only - * evaluate for viewers who could actually see the treatment. - */ - const knownLikersEnabled = - hasSession && - likeCount > 0 && - ax.features.enabled(ax.features.PostThreadKnownLikersEnable) const {data} = useLikedBySampleQuery({ - uri: knownLikersEnabled ? post.uri : undefined, + uri: hasSession && likeCount > 0 ? post.uri : undefined, }) if (likeCount === 0) return null @@ -56,21 +48,24 @@ export function LikesStat({post}: {post: AppBskyFeedDefs.PostView}) { const urip = new AtUri(post.uri) const likesHref = makeProfileLink(post.author, 'post', urip.rkey, 'liked-by') - const knownLikers = - knownLikersEnabled && moderationOpts - ? (data?.likes ?? []) - .map(like => like.actor) - .filter( - actor => - actor.did !== currentAccount?.did && - actor.viewer?.following && - !actor.viewer.muted && - !actor.viewer.blocking && - !actor.viewer.blockedBy, - ) - : [] + const knownLikers = moderationOpts + ? (data?.likes ?? []) + .map(like => like.actor) + .filter( + actor => + actor.did !== currentAccount?.did && + actor.viewer?.following && + !actor.viewer.muted && + !actor.viewer.blocking && + !actor.viewer.blockedBy, + ) + : [] - if (knownLikers.length === 0) { + const showKnownLikers = + knownLikers.length > 0 && + ax.features.enabled(ax.features.PostThreadKnownLikersEnable) + + if (!showKnownLikers) { return (