Skip to content

fix: Prevent TestData from throwing for a flag named constructor or toString - #2173

Merged
kinyoklion merged 3 commits into
mainfrom
rlamb/test-data-built-in-member-keys
Nov 6, 2026
Merged

kinyoklion merged 3 commits into
mainfrom
rlamb/test-data-built-in-member-keys

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

TestData kept flags, segments and flag builders in plain objects, so a flag key that is a built-in object member did not work:

  • flag() threw this._flagBuilders[key].clone is not a function for keys such as constructor, toString or __proto__.
  • update() read the version of the inherited member, so such a flag got the version NaN.
  • A flag or segment named __proto__ was dropped, by assignment and by the object spread in TestDataSource.

These objects now have no prototype. A new unit test configures and changes flags with these keys and reads them from the store.

Opened from termag

SDK-3497


Note

Overview
TestData now stores flags, segments, and flag builders in null-prototype objects (Object.create(null)) instead of {}, so keys like __proto__, constructor, hasOwnProperty, and toString behave as normal flag keys instead of colliding with inherited properties.

TestDataSource applies the same pattern when cloning initial flags/segments (Object.assign(Object.create(null), …) instead of object spread), so __proto__ and similar keys are not lost during copy.

A new integration test configures and updates flags with those keys and asserts they land in the feature store with the expected version and variation.

Reviewed by Cursor Bugbot for commit b6f5a12. Bugbot is set up for automated code reviews on this repo. Configure here.

…oString

TestData kept flags, segments and flag builders in plain objects. flag()
threw for a key that is a built-in object member, such as constructor or
toString, update() gave such a flag the version NaN, and a flag named
__proto__ was dropped. These objects now have no prototype.

Generated-by: termag
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 32497 bytes
Compressed size limit: 32500
Uncompressed size: 153345 bytes

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 34545 bytes
Compressed size limit: 35000
Uncompressed size: 123262 bytes

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26066 bytes
Compressed size limit: 44000
Uncompressed size: 168326 bytes

@kinyoklion
kinyoklion marked this pull request as ready for review November 5, 2026 18:19
@kinyoklion
kinyoklion requested a review from a team as a code owner November 5, 2026 18:19
@kinyoklion
kinyoklion merged commit 4e58d1d into main Nov 6, 2026
68 checks passed
@kinyoklion
kinyoklion deleted the rlamb/test-data-built-in-member-keys branch November 6, 2026 16:44
@github-actions github-actions Bot mentioned this pull request Nov 6, 2026
joker23 pushed a commit that referenced this pull request Nov 6, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>akamai-edgeworker-sdk-common: 2.0.49</summary>

##
[2.0.49](akamai-edgeworker-sdk-common-v2.0.48...akamai-edgeworker-sdk-common-v2.0.49)
(2026-11-06)


### Bug Fixes

* **akamai-edgeworker-sdk:** reduce bundles with dual ESM and CJS output
([#2171](#2171))
([1504e6c](1504e6c))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from ^2.26.3 to ^2.26.4
</details>

<details><summary>akamai-server-base-sdk: 3.0.50</summary>

##
[3.0.50](akamai-server-base-sdk-v3.0.49...akamai-server-base-sdk-v3.0.50)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.48 to
^2.0.49
</details>

<details><summary>akamai-server-edgekv-sdk: 1.4.52</summary>

##
[1.4.52](akamai-server-edgekv-sdk-v1.4.51...akamai-server-edgekv-sdk-v1.4.52)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.48 to
^2.0.49
    * @launchdarkly/js-server-sdk-common bumped from ^2.26.3 to ^2.26.4
</details>

<details><summary>client-testing-plugin: 1.0.31</summary>

##
[1.0.31](client-testing-plugin-v1.0.30...client-testing-plugin-v1.0.31)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped from 1.35.1 to 1.35.2
  * devDependencies
    * @launchdarkly/js-client-sdk bumped from 4.14.1 to 4.14.2
    * @launchdarkly/react-sdk bumped from 4.2.1 to 4.2.2
  * peerDependencies
    * @launchdarkly/js-client-sdk bumped from ^4.9.1 to ^4.14.2
    * @launchdarkly/react-sdk bumped from ^4.1.4 to ^4.2.2
</details>

<details><summary>cloudflare-server-sdk: 2.7.51</summary>

##
[2.7.51](cloudflare-server-sdk-v2.7.50...cloudflare-server-sdk-v2.7.51)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/js-server-sdk-common-edge bumped from 2.6.46 to 2.6.47
</details>

<details><summary>eventsource: 0.2.4</summary>

##
[0.2.4](eventsource-v0.2.3...eventsource-v0.2.4)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-sdk-common bumped from 2.32.1 to 2.32.2
</details>

<details><summary>fastly-server-sdk: 0.2.41</summary>

##
[0.2.41](fastly-server-sdk-v0.2.40...fastly-server-sdk-v0.2.41)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4
</details>

<details><summary>jest: 1.0.41</summary>

##
[1.0.41](jest-v1.0.40...jest-v1.0.41)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/react-native-client-sdk bumped from ~10.23.3 to ~10.23.4
</details>

<details><summary>js-client-sdk: 4.14.2</summary>

##
[4.14.2](js-client-sdk-v4.14.1...js-client-sdk-v4.14.2)
(2026-11-06)


### Bug Fixes

* Keep JSDoc in sdk-client declarations and show inherited LDClient docs
([#2181](#2181))
([09b5f99](09b5f99))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped from 1.35.1 to 1.35.2
  * optionalDependencies
    * @launchdarkly/eventsource bumped from 0.2.3 to 0.2.4
</details>

<details><summary>js-client-sdk-common: 1.35.2</summary>

##
[1.35.2](js-client-sdk-common-v1.35.1...js-client-sdk-common-v1.35.2)
(2026-11-06)


### Bug Fixes

* Keep JSDoc in sdk-client declarations and show inherited LDClient docs
([#2181](#2181))
([09b5f99](09b5f99))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-sdk-common bumped from 2.32.1 to 2.32.2
</details>

<details><summary>js-sdk-common: 2.32.2</summary>

##
[2.32.2](js-sdk-common-v2.32.1...js-sdk-common-v2.32.2)
(2026-11-06)


### Bug Fixes

* Handle flag keys that are names of built-in object members
([#2170](#2170))
([4a18699](4a18699))
</details>

<details><summary>js-server-sdk-common: 2.26.4</summary>

##
[2.26.4](js-server-sdk-common-v2.26.3...js-server-sdk-common-v2.26.4)
(2026-11-06)


### Bug Fixes

* Avoid querying a persistent store on every evaluation of an unknown
flag ([#2169](#2169))
([da1cd35](da1cd35))
* Handle flag keys that are names of built-in object members
([#2170](#2170))
([4a18699](4a18699))
* Keep a flag named __proto__ in file data, change events and persistent
store reads
([#2174](#2174))
([1ffb29b](1ffb29b))
* Make TestData valueForAll return its value when targeting is off
([#2177](#2177))
([fc8c1f6](fc8c1f6))
* Prevent TestData from throwing for a flag named constructor or
toString ([#2173](#2173))
([4e58d1d](4e58d1d))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-sdk-common bumped from 2.32.1 to 2.32.2
</details>

<details><summary>js-server-sdk-common-edge: 2.6.47</summary>

##
[2.6.47](js-server-sdk-common-edge-v2.6.46...js-server-sdk-common-edge-v2.6.47)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4
</details>

<details><summary>node-client-sdk: 4.4.3</summary>

##
[4.4.3](node-client-sdk-v4.4.2...node-client-sdk-v4.4.3)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/eventsource bumped from 0.2.3 to 0.2.4
    * @launchdarkly/js-client-sdk-common bumped from 1.35.1 to 1.35.2
</details>

<details><summary>node-server-sdk: 9.16.4</summary>

##
[9.16.4](node-server-sdk-v9.16.3...node-server-sdk-v9.16.4)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/eventsource bumped from 0.2.3 to 0.2.4
    * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4
</details>

<details><summary>node-server-sdk-dynamodb: 6.4.7</summary>

##
[6.4.7](node-server-sdk-dynamodb-v6.4.6...node-server-sdk-dynamodb-v6.4.7)
(2026-11-06)


### Bug Fixes

* Avoid querying a persistent store on every evaluation of an unknown
flag ([#2169](#2169))
([da1cd35](da1cd35))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.16.3 to 9.16.4
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.14.1 to >=9.16.4
</details>

<details><summary>node-server-sdk-otel: 1.3.43</summary>

##
[1.3.43](node-server-sdk-otel-v1.3.42...node-server-sdk-otel-v1.3.43)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.16.3 to 9.16.4
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.11.3 to >=9.16.4
</details>

<details><summary>node-server-sdk-redis: 4.4.7</summary>

##
[4.4.7](node-server-sdk-redis-v4.4.6...node-server-sdk-redis-v4.4.7)
(2026-11-06)


### Bug Fixes

* Avoid querying a persistent store on every evaluation of an unknown
flag ([#2169](#2169))
([da1cd35](da1cd35))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.16.3 to 9.16.4
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.14.1 to >=9.16.4
</details>

<details><summary>openfeature-cloudflare-server: 1.2.0</summary>

##
[1.2.0](openfeature-cloudflare-server-v1.1.3...openfeature-cloudflare-server-v1.2.0)
(2026-11-06)


### Features

* Add an initialization timeout option to the OpenFeature Cloudflare
provider ([#2182](#2182))
([ba6ee3a](ba6ee3a))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/openfeature-js-server-common bumped from 2.2.2 to 2.2.3
  * devDependencies
    * @launchdarkly/cloudflare-server-sdk bumped from 2.7.50 to 2.7.51
  * peerDependencies
    * @launchdarkly/cloudflare-server-sdk bumped from ^2.7.0 to ^2.7.51
</details>

<details><summary>openfeature-js-server-common: 2.2.3</summary>

##
[2.2.3](openfeature-js-server-common-v2.2.2...openfeature-js-server-common-v2.2.3)
(2026-11-06)


### Bug Fixes

* Align OpenFeature context conversion log levels with the provider spec
([#2183](#2183))
([c356b22](c356b22))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-sdk-common bumped from 2.32.1 to 2.32.2
</details>

<details><summary>openfeature-node-server: 2.1.7</summary>

##
[2.1.7](openfeature-node-server-v2.1.6...openfeature-node-server-v2.1.7)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/openfeature-js-server-common bumped from 2.2.2 to 2.2.3
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.16.3 to 9.16.4
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from ^9.0.0 to ^9.16.4
</details>

<details><summary>react-native-client-sdk: 10.23.4</summary>

##
[10.23.4](react-native-client-sdk-v10.23.3...react-native-client-sdk-v10.23.4)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped from 1.35.1 to 1.35.2
</details>

<details><summary>react-sdk: 4.2.2</summary>

##
[4.2.2](react-sdk-v4.2.1...react-sdk-v4.2.2)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk bumped from 4.14.1 to 4.14.2
    * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4
</details>

<details><summary>server-sdk-ai: 2.0.20</summary>

##
[2.0.20](server-sdk-ai-v2.0.19...server-sdk-ai-v2.0.20)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4
  * peerDependencies
    * @launchdarkly/js-server-sdk-common bumped from ^2.0.0 to ^2.26.4
</details>

<details><summary>server-sdk-ai-langchain: 0.8.31</summary>

##
[0.8.31](server-sdk-ai-langchain-v0.8.30...server-sdk-ai-langchain-v0.8.31)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^2.0.19 to ^2.0.20
  * peerDependencies
* @launchdarkly/server-sdk-ai bumped from ^1.1.1 || ^2.0.0 to ^2.0.20
</details>

<details><summary>server-sdk-ai-openai: 0.7.31</summary>

##
[0.7.31](server-sdk-ai-openai-v0.7.30...server-sdk-ai-openai-v0.7.31)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4
    * @launchdarkly/server-sdk-ai bumped from ^2.0.19 to ^2.0.20
  * peerDependencies
* @launchdarkly/server-sdk-ai bumped from ^1.1.1 || ^2.0.0 to ^2.0.20
</details>

<details><summary>server-sdk-ai-vercel: 0.7.31</summary>

##
[0.7.31](server-sdk-ai-vercel-v0.7.30...server-sdk-ai-vercel-v0.7.31)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^2.0.19 to ^2.0.20
  * peerDependencies
* @launchdarkly/server-sdk-ai bumped from ^1.1.1 || ^2.0.0 to ^2.0.20
</details>

<details><summary>shopify-oxygen-sdk: 0.2.6</summary>

##
[0.2.6](shopify-oxygen-sdk-v0.2.5...shopify-oxygen-sdk-v0.2.6)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.26.3 to 2.26.4
</details>

<details><summary>vercel-server-sdk: 1.3.74</summary>

##
[1.3.74](vercel-server-sdk-v1.3.73...vercel-server-sdk-v1.3.74)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/js-server-sdk-common-edge bumped from 2.6.46 to 2.6.47
</details>

<details><summary>vue-client-sdk: 3.0.11</summary>

##
[3.0.11](vue-client-sdk-v3.0.10...vue-client-sdk-v3.0.11)
(2026-11-06)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk bumped from 4.14.1 to 4.14.2
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> Cuts the Release Please rollout that bumps every published workspace
package, refreshes `.release-please-manifest.json`, and backfills
changelog entries with the new semver tags.
> 
> Functional follow-ups ride along in the version drift:
`js-sdk-common`/`js-server-sdk-common` pick up the flag-key edge-case
fixes, persistent-store short-circuit, and TestData corrections called
out in their notes; `openfeature-cloudflare-server` graduates to `1.2.0`
with an explicit initialization timeout knob wired through
`LaunchDarklyProvider`, while the Akamai common SDK emits slimmer dual
ESM/CJS bundles. Client surfaces (`js-client-sdk`, React/Vue/React
Native wrappers, testing plugin, etc.) absorb the refreshed common
packages so generated typings keep inherited JSDoc.
> 
> Everywhere else is mechanical—AI provider peers now pin
`@launchdarkly/server-sdk-ai` `^2.0.20`, Cloudflare/Fastly/Vercel edge
SDKs advance `js-server-sdk-common-edge`, Redis/Dynamo/OTEL integrations
raise their `node-server-sdk` floor, and sample apps mirror the new
dependency graph.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
52dbf7b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants