Compare commits

...

1 Commits

Author SHA1 Message Date
Eric Bailey b282abd72d Add warning log to gates init 2026-04-16 09:54:27 -05:00
2 changed files with 10 additions and 1 deletions
+9 -1
View File
@@ -2,11 +2,13 @@ import {MMKV} from '@bsky.app/react-native-mmkv'
import {setPolyfills} from '@growthbook/growthbook'
import {GrowthBook} from '@growthbook/growthbook-react'
import {Logger} from '#/logger'
import {getNavigationMetadata, type Metadata} from '#/analytics/metadata'
import * as env from '#/env'
export {Features} from '#/analytics/features/types'
const logger = Logger.create(Logger.Context.Growthbook)
const CACHE = new MMKV({id: 'bsky_features_cache'})
setPolyfills({
@@ -44,7 +46,13 @@ export const features = new GrowthBook({
* initialization completes.
*/
export const init = new Promise<void>(async y => {
await features.init({timeout: TIMEOUT_INIT})
const res = await features.init({timeout: TIMEOUT_INIT})
if (!res.success) {
logger.warn('GrowthBook initialization failed or timed out', {
source: res.source,
safeMessage: res.error?.toString(),
})
}
y()
})
+1
View File
@@ -16,6 +16,7 @@ export enum LogContext {
PolicyUpdate = 'policy-update',
Geolocation = 'geolocation',
Drafts = 'drafts',
Growthbook = 'growthbook',
/**
* METRIC IS FOR INTERNAL USE ONLY, don't create any other loggers using this