* 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
()
| 464 | * process's SDK key. |
| 465 | */ |
| 466 | function 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 |
no test coverage detected