From f942e15c8ee0c49051d6f671c0b1af40cb8b3188 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 19 Nov 2024 10:50:33 -0300 Subject: [PATCH 1/4] Updated JS-commons, where factory 'init' and 'destroy' methods support re-initialization after destruction --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/__tests__/nodeSuites/lazy-init.spec.js | 2 ++ src/settings/defaults/version.js | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index afd28f867..7221852c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@splitsoftware/splitio", - "version": "11.0.1", + "version": "11.0.2-rc.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio", - "version": "11.0.1", + "version": "11.0.2-rc.0", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio-commons": "2.0.0", + "@splitsoftware/splitio-commons": "2.0.1-rc.0", "bloom-filters": "^3.0.0", "ioredis": "^4.28.0", "js-yaml": "^3.13.1", @@ -869,9 +869,9 @@ "dev": true }, "node_modules/@splitsoftware/splitio-commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.0.tgz", - "integrity": "sha512-Sz4+vFacl29xw3451z9IUgB4zBFKUWZdCnmOB0DDXA803YKPqjXphdAwN6nV+1vsX9pXV/OS6UaNC4oUICa6PA==", + "version": "2.0.1-rc.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.1-rc.0.tgz", + "integrity": "sha512-z5dSmuG5NRYB8KKw3AJPMoJ15yzbpEv8EZr1+RqcZ0Bk+jwBzEyGoJ7abvRftuLkegaryDvi5mYAUeTPkNfC5w==", "dependencies": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" @@ -8587,9 +8587,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.0.tgz", - "integrity": "sha512-Sz4+vFacl29xw3451z9IUgB4zBFKUWZdCnmOB0DDXA803YKPqjXphdAwN6nV+1vsX9pXV/OS6UaNC4oUICa6PA==", + "version": "2.0.1-rc.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.1-rc.0.tgz", + "integrity": "sha512-z5dSmuG5NRYB8KKw3AJPMoJ15yzbpEv8EZr1+RqcZ0Bk+jwBzEyGoJ7abvRftuLkegaryDvi5mYAUeTPkNfC5w==", "requires": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" diff --git a/package.json b/package.json index 2a0cd4390..09e4e13cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "11.0.1", + "version": "11.0.2-rc.0", "description": "Split SDK", "files": [ "README.md", @@ -38,7 +38,7 @@ "node": ">=14.0.0" }, "dependencies": { - "@splitsoftware/splitio-commons": "2.0.0", + "@splitsoftware/splitio-commons": "2.0.1-rc.0", "bloom-filters": "^3.0.0", "ioredis": "^4.28.0", "js-yaml": "^3.13.1", diff --git a/src/__tests__/nodeSuites/lazy-init.spec.js b/src/__tests__/nodeSuites/lazy-init.spec.js index 68e92e8f5..7760c4519 100644 --- a/src/__tests__/nodeSuites/lazy-init.spec.js +++ b/src/__tests__/nodeSuites/lazy-init.spec.js @@ -34,6 +34,7 @@ export default function (settings, fetchMock, t) { fetchMock.postOnce('https://not-called/api/testImpressions/bulk', 200); fetchMock.postOnce('https://not-called/api/events/bulk', 200); + for (let i = 0; i < 3; i++) { splitio.init(); splitio.init(); splitio.destroy(); splitio.destroy(); } splitio.init(); await splitio.client().ready(); assert.true(splitio.client().__getStatus().isReady, 'Split SDK is ready'); @@ -79,6 +80,7 @@ export default function (settings, fetchMock, t) { fetchMock.postOnce('https://not-called/api/testImpressions/bulk', 200); fetchMock.postOnce('https://not-called/api/events/bulk', 200); + for (let i = 0; i < 3; i++) { splitio.init(); splitio.init(); splitio.destroy(); splitio.destroy(); } splitio.init(); await splitio.client().ready(); assert.true(splitio.client().__getStatus().isReady, 'Split SDK is ready'); diff --git a/src/settings/defaults/version.js b/src/settings/defaults/version.js index feec3d6b5..2461de8bd 100644 --- a/src/settings/defaults/version.js +++ b/src/settings/defaults/version.js @@ -1 +1 @@ -export const packageVersion = '11.0.1'; +export const packageVersion = '11.0.2-rc.0'; From 4fe8e4ececac1bde9cc0b97b9fcc3399b89197c2 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 3 Dec 2024 16:02:20 -0300 Subject: [PATCH 2/4] Update JS-commons --- .github/workflows/ci-cd.yml | 4 ++-- CHANGES.txt | 3 +++ package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/settings/defaults/version.js | 2 +- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index d28295fdb..f812189c6 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -58,7 +58,7 @@ jobs: run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build - name: Store assets - if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master') }} + if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/javascript_client_issue_847' || github.ref == 'refs/heads/master') }} uses: actions/upload-artifact@v3 with: name: assets @@ -69,7 +69,7 @@ jobs: name: Upload assets runs-on: ubuntu-20.04 needs: build - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/javascript_client_issue_847' }} strategy: matrix: environment: diff --git a/CHANGES.txt b/CHANGES.txt index 308031209..7cd078dd3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +11.0.3 (December 4, 2024) + - Bugfixing - Updated @splitsoftware/splitio-commons package to version 2.0.2 that sanitizes the `SplitSDKMachineName` header value to avoid exceptions on HTTP/S requests when it contains non ISO-8859-1 characters (Related to issue https://github.com/splitio/javascript-client/issues/847). + 11.0.2 (November 25, 2024) - Updated bloom-filters and fetch-mock dependencies for vulnerability fixes. - Bugfixing - Updated @splitsoftware/splitio-commons package to version 2.0.1 that fixes an issue with the SDK_UPDATE event on Node.js, where it was not being emitted if there was an empty segment and the SDK received a feature flag update notification. diff --git a/package-lock.json b/package-lock.json index 20c5e302f..dbb88830f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@splitsoftware/splitio", - "version": "11.0.2-rc.0", + "version": "11.0.3-rc.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio", - "version": "11.0.2-rc.0", + "version": "11.0.3-rc.0", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio-commons": "2.0.1-rc.0", + "@splitsoftware/splitio-commons": "2.0.2", "bloom-filters": "^3.0.4", "ioredis": "^4.28.0", "js-yaml": "^3.13.1", @@ -351,9 +351,9 @@ "dev": true }, "node_modules/@splitsoftware/splitio-commons": { - "version": "2.0.1-rc.0", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.1-rc.0.tgz", - "integrity": "sha512-z5dSmuG5NRYB8KKw3AJPMoJ15yzbpEv8EZr1+RqcZ0Bk+jwBzEyGoJ7abvRftuLkegaryDvi5mYAUeTPkNfC5w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.2.tgz", + "integrity": "sha512-r2m3kwWnSuROT+7zTzhWBrM0DMRBGJNQcTyvXw8zLPPmBs/PnmAnxCy7uRpfMHOGbP9Q3Iju0bU/H5dG8svyiw==", "dependencies": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" @@ -7537,9 +7537,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "2.0.1-rc.0", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.1-rc.0.tgz", - "integrity": "sha512-z5dSmuG5NRYB8KKw3AJPMoJ15yzbpEv8EZr1+RqcZ0Bk+jwBzEyGoJ7abvRftuLkegaryDvi5mYAUeTPkNfC5w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.2.tgz", + "integrity": "sha512-r2m3kwWnSuROT+7zTzhWBrM0DMRBGJNQcTyvXw8zLPPmBs/PnmAnxCy7uRpfMHOGbP9Q3Iju0bU/H5dG8svyiw==", "requires": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" diff --git a/package.json b/package.json index 11856fa56..edc3e9f8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "11.0.2-rc.0", + "version": "11.0.3-rc.0", "description": "Split SDK", "files": [ "README.md", @@ -38,7 +38,7 @@ "node": ">=14.0.0" }, "dependencies": { - "@splitsoftware/splitio-commons": "2.0.1-rc.0", + "@splitsoftware/splitio-commons": "2.0.2", "bloom-filters": "^3.0.4", "ioredis": "^4.28.0", "js-yaml": "^3.13.1", diff --git a/src/settings/defaults/version.js b/src/settings/defaults/version.js index 2461de8bd..d60017316 100644 --- a/src/settings/defaults/version.js +++ b/src/settings/defaults/version.js @@ -1 +1 @@ -export const packageVersion = '11.0.2-rc.0'; +export const packageVersion = '11.0.3-rc.0'; From 2275362c07d4f2ea1bfcdda4446e1db13096a63c Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 3 Dec 2024 16:14:53 -0300 Subject: [PATCH 3/4] stable version --- .github/workflows/ci-cd.yml | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- src/settings/defaults/version.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index f812189c6..d28295fdb 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -58,7 +58,7 @@ jobs: run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") npm run build - name: Store assets - if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/javascript_client_issue_847' || github.ref == 'refs/heads/master') }} + if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master') }} uses: actions/upload-artifact@v3 with: name: assets @@ -69,7 +69,7 @@ jobs: name: Upload assets runs-on: ubuntu-20.04 needs: build - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/javascript_client_issue_847' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} strategy: matrix: environment: diff --git a/package-lock.json b/package-lock.json index dbb88830f..a6959f97e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio", - "version": "11.0.3-rc.0", + "version": "11.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio", - "version": "11.0.3-rc.0", + "version": "11.0.3", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio-commons": "2.0.2", diff --git a/package.json b/package.json index edc3e9f8e..d62fd35b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "11.0.3-rc.0", + "version": "11.0.3", "description": "Split SDK", "files": [ "README.md", diff --git a/src/settings/defaults/version.js b/src/settings/defaults/version.js index d60017316..c1fb40805 100644 --- a/src/settings/defaults/version.js +++ b/src/settings/defaults/version.js @@ -1 +1 @@ -export const packageVersion = '11.0.3-rc.0'; +export const packageVersion = '11.0.3'; From 11ee45feeab54ce6a7f200fa66ec5b198ce0ecea Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 4 Dec 2024 13:52:54 -0300 Subject: [PATCH 4/4] Test polishing --- src/__tests__/nodeSuites/lazy-init.spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/__tests__/nodeSuites/lazy-init.spec.js b/src/__tests__/nodeSuites/lazy-init.spec.js index 7760c4519..bee1efbc9 100644 --- a/src/__tests__/nodeSuites/lazy-init.spec.js +++ b/src/__tests__/nodeSuites/lazy-init.spec.js @@ -34,7 +34,9 @@ export default function (settings, fetchMock, t) { fetchMock.postOnce('https://not-called/api/testImpressions/bulk', 200); fetchMock.postOnce('https://not-called/api/events/bulk', 200); + // Validate that init and destroy are idempotent for (let i = 0; i < 3; i++) { splitio.init(); splitio.init(); splitio.destroy(); splitio.destroy(); } + splitio.init(); await splitio.client().ready(); assert.true(splitio.client().__getStatus().isReady, 'Split SDK is ready'); @@ -80,7 +82,9 @@ export default function (settings, fetchMock, t) { fetchMock.postOnce('https://not-called/api/testImpressions/bulk', 200); fetchMock.postOnce('https://not-called/api/events/bulk', 200); + // Validate that init and destroy are idempotent for (let i = 0; i < 3; i++) { splitio.init(); splitio.init(); splitio.destroy(); splitio.destroy(); } + splitio.init(); await splitio.client().ready(); assert.true(splitio.client().__getStatus().isReady, 'Split SDK is ready');