···22import {setPolyfills} from '@growthbook/growthbook'
33import {GrowthBook} from '@growthbook/growthbook-react'
4455+import {Logger} from '#/logger'
56import {getNavigationMetadata, type Metadata} from '#/analytics/metadata'
67import * as env from '#/env'
7889export {Features} from '#/analytics/features/types'
9101111+const logger = Logger.create(Logger.Context.Growthbook)
1012const CACHE = new MMKV({id: 'bsky_features_cache'})
11131214setPolyfills({
···4446 * initialization completes.
4547 */
4648export const init = new Promise<void>(async y => {
4747- await features.init({timeout: TIMEOUT_INIT})
4949+ const res = await features.init({timeout: TIMEOUT_INIT})
5050+ if (!res.success) {
5151+ logger.warn('GrowthBook initialization failed or timed out', {
5252+ source: res.source,
5353+ safeMessage: res.error?.toString(),
5454+ })
5555+ }
4856 y()
4957})
5058
+1
src/logger/types.ts
···1616 PolicyUpdate = 'policy-update',
1717 Geolocation = 'geolocation',
1818 Drafts = 'drafts',
1919+ Growthbook = 'growthbook',
19202021 /**
2122 * METRIC IS FOR INTERNAL USE ONLY, don't create any other loggers using this