MCPcopy Create free account
hub / github.com/Noumena-Network/code / syncGrowthBookCacheToDisk

Function syncGrowthBookCacheToDisk

src/services/analytics/growthbook.ts:466–476  ·  view source on GitHub ↗

* Write the complete resolvedFeatureValues map to disk. Called exactly * once per successful processGrowthBookPayload — never from a failure path, * so init-timeout poisoning is structurally impossible (the .catch() at init * never reaches here). * * Wholesale replace (not merge): features dele

()

Source from the content-addressed store, hash-verified

464 * process's SDK key.
465 */
466function syncGrowthBookCacheToDisk(): void {
467 const fresh = Object.fromEntries(resolvedFeatureValues)
468 const config = getGlobalConfig()
469 if (isEqual(config.cachedGrowthBookFeatures, fresh)) {
470 return
471 }
472 saveGlobalConfig(current => ({
473 ...current,
474 cachedGrowthBookFeatures: fresh,
475 }))
476}
477
478/**
479 * Check if GrowthBook operations should be enabled

Callers 2

finalizeInitFunction · 0.85

Calls 2

getGlobalConfigFunction · 0.50
saveGlobalConfigFunction · 0.50

Tested by

no test coverage detected