Fix GrowthBook cache breaking on cold start (#10282)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-04-17 10:12:12 -07:00
committed by GitHub
parent e58feaeb0f
commit 226a321a27
+2 -3
View File
@@ -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