Repository navigation
馃悰 fix(browser): preserve exposure cache updates across instances - #412
Conversation
OpenFeature Browser Provider Bundle SizesMeasured from the Vite production output after installing packed Both scenarios initialize an OpenFeature provider, evaluate a boolean flag, change context, and evaluate again. Telemetry is disabled for DatadogProvider; no tracking hooks are registered for DatadogCoreProvider. DatadogProvider fetches precomputed assignments for each context; DatadogCoreProvider receives rules from fetchRulesConfiguration once and evaluates locally. Sizes include OpenFeature and the same small scenario harness. Configuration responses are supplied by Playwright and are not bundled. These are complete scenario JS sizes, not configuration payload sizes or isolated provider/Protobuf costs; the difference between rows is not a decoder-only delta.
Dependency checks passed: no Protobuf markers in default/precomputed scenarios; markers present in rules-based scenarios. OpenFeature Browser Tracking Hook Bundle SizesSynthetic entrypoints import and call tracking hook factories from the packed
OpenFeature Node Server Bundle SizesIndependent Webpack production builds of the installed core and Node SDK tarballs, targeting Node 18 with ESM (
Adding SSR helpers to the provider adds 79.7 KiB raw / 22.1 KiB gzip in this build. This includes fetching, parsing, and serialization, not just the decoder. SSR helpers fetch rules for the browser, not for configuring that provider (which uses its existing JSON API). These are bundler sizes, not npm install sizes, unbundled Node require/import costs, payload sizes, or latency. Gzip compares compressed artifacts. The browser scenarios include OpenFeature and a different harness, so their sizes are not directly comparable. Dependency checks passed: no Protobuf runtime or generated schema modules in the provider-only bundle; present in both SSR bundles (checked using Webpack module statistics). This report shows current PR artifact sizes only; it does not compare against the base branch. |
c105cc4
into
leo/move-assignment-cache-to-indexeddb
Motivation
Follow-up to #188, targeting
leo/move-assignment-cache-to-indexeddb.Two tabs or hooks sharing an exposure-cache scope can overwrite each other's committed entries when they persist their own memory snapshots. A stale instance can also restore entries another instance cleared, or overwrite a newer assignment.
Changes
Implementation and tests were prepared with Codex.
Test instructions
Also load the same persisted entry into two cache instances, clear it through the first, then record a different exposure through the second. Reloading must retain the new exposure without restoring the cleared entry.
Run the browser suite with:
yarn workspace @datadog/openfeature-browser test --runInBand --watchman=falseChecklist