launchdarkly-node-client-sdk 3.4.3 → 3.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ jobs:
16
16
  matrix:
17
17
  variations: [
18
18
  {os: ubuntu-latest, node: latest},
19
- {os: ubuntu-latest, node: 18}
19
+ {os: ubuntu-latest, node: '^24.19.0'}
20
20
  ]
21
21
 
22
22
  runs-on: ${{ matrix.variations.os }}
@@ -24,8 +24,8 @@ jobs:
24
24
  TEST_SERVICE_PORT: 8000
25
25
 
26
26
  steps:
27
- - uses: actions/checkout@v4
28
- - uses: actions/setup-node@v4
27
+ - uses: actions/checkout@v7
28
+ - uses: actions/setup-node@v7
29
29
  with:
30
30
  node-version: ${{ matrix.variations.node }}
31
31
  registry-url: 'https://registry.npmjs.org'
@@ -27,17 +27,13 @@ jobs:
27
27
  contents: write
28
28
  if: ${{ needs.release-please.outputs.release_created == 'true' }}
29
29
  steps:
30
- - uses: actions/checkout@v4
30
+ - uses: actions/checkout@v7
31
31
 
32
- - uses: actions/setup-node@v4
32
+ - uses: actions/setup-node@v7
33
33
  with:
34
- node-version: 24.x
34
+ node-version: '^24.19.0'
35
35
  registry-url: 'https://registry.npmjs.org'
36
36
 
37
- - name: Update NPM
38
- shell: bash
39
- # Must be greater than 11.5.1 for OIDC.
40
- run: npm install -g npm@11.6.2
41
37
 
42
38
  - name: Install Dependencies
43
39
  run: npm install
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "3.4.3"
2
+ ".": "3.4.5"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to the LaunchDarkly Client-Side SDK for Node.js will be documented in this file.
4
4
 
5
+ ## [3.4.5](https://github.com/launchdarkly/node-client-sdk/compare/3.4.4...3.4.5) (2026-11-20)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Update launchdarkly-js-sdk-common to 5.8.4 ([#83](https://github.com/launchdarkly/node-client-sdk/issues/83)) ([bd23d24](https://github.com/launchdarkly/node-client-sdk/commit/bd23d2423add6ae483405531853e4b362e5ed252))
11
+
12
+ ## [3.4.4](https://github.com/launchdarkly/node-client-sdk/compare/3.4.3...3.4.4) (2026-11-20)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * Fail the flag request when the response body is cut off ([#80](https://github.com/launchdarkly/node-client-sdk/issues/80)) ([3ca3ac7](https://github.com/launchdarkly/node-client-sdk/commit/3ca3ac7752426b56614cfdc933ac8194ea837a0c))
18
+
5
19
  ## [3.4.3](https://github.com/launchdarkly/node-client-sdk/compare/3.4.2...3.4.3) (2026-08-06)
6
20
 
7
21
 
package/README.md CHANGED
@@ -23,7 +23,7 @@ For using LaunchDarkly in *server-side* Node.js applications, refer to our [Serv
23
23
 
24
24
  ## Supported Node versions
25
25
 
26
- This version of the LaunchDarkly SDK is compatible with Node.js versions 12 and above.
26
+ While this version of the LaunchDarkly SDK requires Node.js 12 or later, you should use the latest patched version of a supported Node.js release.
27
27
 
28
28
  ## Getting started
29
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "launchdarkly-node-client-sdk",
3
- "version": "3.4.3",
3
+ "version": "3.4.5",
4
4
  "description": "LaunchDarkly Client-Side SDK for Node.js",
5
5
  "author": "LaunchDarkly <team@launchdarkly.com>",
6
6
  "license": "Apache-2.0",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "launchdarkly-eventsource": "2.0.3",
69
- "launchdarkly-js-sdk-common": "5.8.3",
69
+ "launchdarkly-js-sdk-common": "5.8.4",
70
70
  "node-localstorage": "^1.3.1"
71
71
  },
72
72
  "repository": {
@@ -72,6 +72,32 @@ describe('nodePlatform', () => {
72
72
  await expect(requestInfo.promise).rejects.toThrow();
73
73
  });
74
74
  });
75
+
76
+ it('rejects promise if the connection closes before the response body is complete', async () => {
77
+ await withCloseable(TestHttpServers.start, async server => {
78
+ server.byDefault((req, res) => {
79
+ res.writeHead(200, { 'Content-Type': 'application/json', 'Content-Length': 100 });
80
+ // Send part of the body, then close the connection normally.
81
+ res.write('{"flag":', () => res.socket.end());
82
+ });
83
+ const requestInfo = platform.httpRequest('GET', server.url);
84
+
85
+ await expect(requestInfo.promise).rejects.toThrow();
86
+ });
87
+ });
88
+
89
+ it('rejects promise if the connection is reset before the response body is complete', async () => {
90
+ await withCloseable(TestHttpServers.start, async server => {
91
+ server.byDefault((req, res) => {
92
+ res.writeHead(200, { 'Content-Type': 'application/json', 'Content-Length': 100 });
93
+ // Send part of the body, then reset the connection.
94
+ res.write('{"flag":', () => res.socket.resetAndDestroy());
95
+ });
96
+ const requestInfo = platform.httpRequest('GET', server.url);
97
+
98
+ await expect(requestInfo.promise).rejects.toThrow();
99
+ });
100
+ });
75
101
  });
76
102
 
77
103
  describe('getCurrentUrl()', () => {
@@ -29,6 +29,15 @@ function newHttpRequest(method, requestUrl, headers, body, tlsParams) {
29
29
  body: resBody,
30
30
  });
31
31
  });
32
+ // The response can stop before the body is complete, for example if the connection closes or
33
+ // resets. Reject the request in that case. Some Node versions send an error event, and others
34
+ // send only a close event.
35
+ res.on('error', reject);
36
+ res.on('close', () => {
37
+ if (!res.complete) {
38
+ reject(new Error('the connection closed before the response body was complete'));
39
+ }
40
+ });
32
41
  });
33
42
 
34
43
  request.on('error', reject);