From e37e25ce595ce33da84de8ef8c274856d0f7b264 Mon Sep 17 00:00:00 2001 From: Alex Benzer Date: Fri, 10 Jul 2026 17:28:00 -0700 Subject: [PATCH] Add killswitch to getLikes request --- src/analytics/features/types.ts | 1 + src/screens/PostThread/components/LikesStat.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/analytics/features/types.ts b/src/analytics/features/types.ts index 283ef37088..b890873a37 100644 --- a/src/analytics/features/types.ts +++ b/src/analytics/features/types.ts @@ -13,6 +13,7 @@ export enum Features { ComposerLanguageDetectionEnable = 'composer:language_detection:enable', PostGalleryEmbedEnable = 'post_gallery_embed:enable', PostThreadKnownLikersEnable = 'post_thread:known_likers:enable', + PostThreadKnownLikersFetchEnable = 'post_thread:known_likers:fetch:enable', AATest = 'aa-test', } diff --git a/src/screens/PostThread/components/LikesStat.tsx b/src/screens/PostThread/components/LikesStat.tsx index 22e3fa4a32..4316b0b9b9 100644 --- a/src/screens/PostThread/components/LikesStat.tsx +++ b/src/screens/PostThread/components/LikesStat.tsx @@ -39,8 +39,15 @@ export function LikesStat({post}: {post: AppBskyFeedDefs.PostView}) { const ax = useAnalytics() const likeCount = post.likeCount ?? 0 + /* + * Kill switch for the getLikes sample request itself, separate from the + * display gate below. + */ + const fetchEnabled = ax.features.enabled( + ax.features.PostThreadKnownLikersFetchEnable, + ) const {data} = useLikedBySampleQuery({ - uri: hasSession && likeCount > 0 ? post.uri : undefined, + uri: fetchEnabled && hasSession && likeCount > 0 ? post.uri : undefined, }) if (likeCount === 0) return null