From 226a321a2726b8a8cc395dbf87d88a3cc2b8e7bc Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 17 Apr 2026 10:12:12 -0700 Subject: [PATCH] Fix GrowthBook cache breaking on cold start (#10282) Co-authored-by: Claude Opus 4.6 (1M context) --- src/analytics/features/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/analytics/features/index.ts b/src/analytics/features/index.ts index 4644d7f1b4..7ec6f359a7 100644 --- a/src/analytics/features/index.ts +++ b/src/analytics/features/index.ts @@ -14,8 +14,7 @@ const CACHE = new MMKV({id: 'bsky_features_cache'}) setPolyfills({ localStorage: { getItem: key => { - const value = CACHE.getString(key) - return value != null ? JSON.parse(value) : null + return CACHE.getString(key) ?? null }, setItem: async (key, value) => { CACHE.set(key, value) @@ -29,7 +28,7 @@ setPolyfills({ */ export type FeatureFetchStrategy = 'prefer-low-latency' | 'prefer-fresh-gates' -const TIMEOUT_INIT = 500 // TODO should base on p99 or something +const TIMEOUT_INIT = 2000 // TODO should base on p99 or something const TIMEOUT_PREFER_LOW_LATENCY = 250 const TIMEOUT_PREFER_FRESH_GATES = 1500