From f239d888e57ccbc6c47fedb513bb334527c1d1db Mon Sep 17 00:00:00 2001 From: taranvohra Date: Mon, 15 Dec 2025 12:56:08 +0530 Subject: [PATCH] Rollout meta links resolution to all sites --- .../src/components/SitePage/SitePage.tsx | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/packages/gitbook/src/components/SitePage/SitePage.tsx b/packages/gitbook/src/components/SitePage/SitePage.tsx index f802d08bcb..e75a89c346 100644 --- a/packages/gitbook/src/components/SitePage/SitePage.tsx +++ b/packages/gitbook/src/components/SitePage/SitePage.tsx @@ -297,7 +297,7 @@ async function getPageDataWithFallback(args: { }) { const { context: baseContext, pagePathParams } = args; const { context, pageTarget } = await fetchPageData(baseContext, pagePathParams); - const pageMetaLinks = await (pageTarget?.page && shouldResolveMetaLinks(context.site.id) + const pageMetaLinks = await (pageTarget?.page ? resolvePageMetaLinks(context, pageTarget.page.id) : null); @@ -359,29 +359,6 @@ async function resolvePageMetaLinks( }; } -/** - * Determine whether to resolve meta links for a site based on a percentage rollout. - */ -function shouldResolveMetaLinks(siteId: string): boolean { - const META_LINKS_PERCENTAGE_ROLLOUT = 50; - const ALLOWED_SITES: Record = { - site_CZrtk: true, - }; - - if (ALLOWED_SITES[siteId] || process.env.NODE_ENV === 'development') { - return true; - } - - // compute a simple hash of the siteId - let hash = 0; - for (let i = 0; i < siteId.length; i++) { - hash = (hash << 5) - hash + siteId.charCodeAt(i); - hash = hash & hash; // Convert to 32-bit integer - } - - return Math.abs(hash % 100) < META_LINKS_PERCENTAGE_ROLLOUT; -} - /** * Get the for a page. */