From 7678e00e9eb05c3c71dc061fb0f22f9e26afda7d Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 18 Dec 2024 00:21:57 -0300 Subject: [PATCH 1/4] Update some links and fix redis and ready-from-cache tests --- README.md | 2 +- src/__tests__/browserSuites/ready-from-cache.spec.js | 10 +++++----- src/__tests__/consumer/node_redis.spec.js | 6 +++--- src/__tests__/testUtils/index.js | 4 ++-- types/client/index.d.ts | 2 +- types/index.d.ts | 2 +- types/server/index.d.ts | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 13c1eea80..77ad5b5fa 100644 --- a/README.md +++ b/README.md @@ -84,4 +84,4 @@ For a comprehensive list of open source projects visit our [Github page](https:/ **Learn more about Split:** -Visit [split.io/product](https://www.split.io/product) for an overview of Split, or visit our documentation at [help.split.io](http://help.split.io) for more detailed information. +Visit [split.io/product](https://www.split.io/product) for an overview of Split, or visit our documentation at [help.split.io](https://help.split.io) for more detailed information. diff --git a/src/__tests__/browserSuites/ready-from-cache.spec.js b/src/__tests__/browserSuites/ready-from-cache.spec.js index b0ffd6706..0e9cdd90f 100644 --- a/src/__tests__/browserSuites/ready-from-cache.spec.js +++ b/src/__tests__/browserSuites/ready-from-cache.spec.js @@ -564,7 +564,7 @@ export default function (fetchMock, assert) { }); client.once(client.Event.SDK_READY, () => { - t.deepEqual(manager.names(), ['p1__split', 'p2__split'], 'p1__split should be added for evaluation'); + t.deepEqual(manager.names().sort(), ['p1__split', 'p2__split'], 'p1__split should be added for evaluation'); client.destroy().then(() => { t.equal(localStorage.getItem('readyFromCache_5B.SPLITIO.splits.till'), '1457552620999', 'splits.till must correspond to the till of the last successfully fetched Splits'); @@ -610,11 +610,11 @@ export default function (fetchMock, assert) { const manager = splitio.manager(); client.once(client.Event.SDK_READY_FROM_CACHE, () => { - t.deepEqual(manager.names(), ['p2__split', 'p1__split'], 'splits shouldn\'t be removed for evaluation'); + t.deepEqual(manager.names().sort(), ['p1__split', 'p2__split'], 'splits shouldn\'t be removed for evaluation'); }); client.once(client.Event.SDK_READY, () => { - t.deepEqual(manager.names(), ['p2__split', 'p1__split'], 'active splits should be present for evaluation'); + t.deepEqual(manager.names().sort(), ['p1__split', 'p2__split'], 'active splits should be present for evaluation'); client.destroy().then(() => { t.equal(localStorage.getItem('some_user_item'), 'user_item', 'user items at localStorage must not be changed'); @@ -667,7 +667,7 @@ export default function (fetchMock, assert) { }); client.once(client.Event.SDK_READY, () => { - t.deepEqual(manager.names(), ['p2__split', 'p1__split'], 'active splits should be present for evaluation'); + t.deepEqual(manager.names().sort(), ['p1__split', 'p2__split'], 'active splits should be present for evaluation'); client.destroy().then(() => { t.equal(localStorage.getItem('some_user_item'), 'user_item', 'user items at localStorage must not be changed'); @@ -780,7 +780,7 @@ export default function (fetchMock, assert) { const manager = splitio.manager(); client.once(client.Event.SDK_READY, () => { - t.deepEqual(manager.names(), ['p3__split', 'p2__split'], 'active splits should be present for evaluation'); + t.deepEqual(manager.names().sort(), ['p2__split', 'p3__split'], 'active splits should be present for evaluation'); client.destroy().then(() => { t.equal(localStorage.getItem('some_user_item'), 'user_item', 'user items at localStorage must not be changed'); diff --git a/src/__tests__/consumer/node_redis.spec.js b/src/__tests__/consumer/node_redis.spec.js index 8092f1910..457631bac 100644 --- a/src/__tests__/consumer/node_redis.spec.js +++ b/src/__tests__/consumer/node_redis.spec.js @@ -181,7 +181,7 @@ tape('Node.js Redis', function (t) { assert.deepEqual(trackedImpressionsAndEvents, [TOTAL_RAW_IMPRESSIONS, TOTAL_EVENTS], 'Tracked impressions and events should be stored in Redis'); // Validate stored telemetry - exec(`echo "HLEN ${config.storage.prefix}.SPLITIO.telemetry.latencies \n HLEN ${config.storage.prefix}.SPLITIO.telemetry.exceptions \n HGET ${config.storage.prefix}.SPLITIO.telemetry.init nodejs-${version}/${HOSTNAME_VALUE}/${IP_VALUE}" | redis-cli -p ${redisPort}`, (error, stdout) => { + exec(`echo "HLEN ${config.storage.prefix}.SPLITIO.telemetry.latencies \n HLEN ${config.storage.prefix}.SPLITIO.telemetry.exceptions \n HGET ${config.storage.prefix}.SPLITIO.telemetry.init 'nodejs-${version}/${HOSTNAME_VALUE}/${IP_VALUE}'" | redis-cli -p ${redisPort}`, (error, stdout) => { if (error) assert.fail('Redis server should be reachable'); const [latencies, exceptions, configValue] = stdout.split('\n').filter(line => line !== '').map(JSON.parse); @@ -304,7 +304,7 @@ tape('Node.js Redis', function (t) { assert.deepEqual(trackedImpressionsAndEvents, [TOTAL_RAW_IMPRESSIONS - DEDUPED_IMPRESSIONS, TOTAL_EVENTS], 'Tracked impressions and events should be stored in Redis'); // Validate stored telemetry - exec(`echo "HLEN ${config.storage.prefix}.SPLITIO.telemetry.latencies \n HLEN ${config.storage.prefix}.SPLITIO.telemetry.exceptions \n HGET ${config.storage.prefix}.SPLITIO.telemetry.init nodejs-${version}/${HOSTNAME_VALUE}/${IP_VALUE}" | redis-cli -p ${redisPort}`, (error, stdout) => { + exec(`echo "HLEN ${config.storage.prefix}.SPLITIO.telemetry.latencies \n HLEN ${config.storage.prefix}.SPLITIO.telemetry.exceptions \n HGET ${config.storage.prefix}.SPLITIO.telemetry.init 'nodejs-${version}/${HOSTNAME_VALUE}/${IP_VALUE}'" | redis-cli -p ${redisPort}`, (error, stdout) => { if (error) assert.fail('Redis server should be reachable'); const [latencies, exceptions, configValue] = stdout.split('\n').filter(line => line !== '').map(JSON.parse); @@ -406,7 +406,7 @@ tape('Node.js Redis', function (t) { assert.deepEqual(trackedImpressionsAndEvents, [0, TOTAL_EVENTS], 'No impressions are stored in Redis in NONE impressions mode'); // Validate stored telemetry - exec(`echo "HLEN ${config.storage.prefix}.SPLITIO.telemetry.latencies \n HLEN ${config.storage.prefix}.SPLITIO.telemetry.exceptions \n HGET ${config.storage.prefix}.SPLITIO.telemetry.init nodejs-${version}/${HOSTNAME_VALUE}/${IP_VALUE}" | redis-cli -p ${redisPort}`, (error, stdout) => { + exec(`echo "HLEN ${config.storage.prefix}.SPLITIO.telemetry.latencies \n HLEN ${config.storage.prefix}.SPLITIO.telemetry.exceptions \n HGET ${config.storage.prefix}.SPLITIO.telemetry.init 'nodejs-${version}/${HOSTNAME_VALUE}/${IP_VALUE}'" | redis-cli -p ${redisPort}`, (error, stdout) => { if (error) assert.fail('Redis server should be reachable'); const [latencies, exceptions, configValue] = stdout.split('\n').filter(line => line !== '').map(JSON.parse); diff --git a/src/__tests__/testUtils/index.js b/src/__tests__/testUtils/index.js index 5994a3c30..35c601fd1 100644 --- a/src/__tests__/testUtils/index.js +++ b/src/__tests__/testUtils/index.js @@ -18,8 +18,8 @@ export function nearlyEqual(actual, expected, epsilon = DEFAULT_ERROR_MARGIN) { * - when `?since=-1`, it returns the given segment `keys` in `added` list. * - otherwise, it returns empty `added` and `removed` lists, and the same since and till values. * - * @param {Object} fetchMock see http://www.wheresrhys.co.uk/fetch-mock - * @param {string|RegExp|...} matcher see http://www.wheresrhys.co.uk/fetch-mock/#api-mockingmock_matcher + * @param {Object} fetchMock see https://www.wheresrhys.co.uk/fetch-mock + * @param {string|RegExp|...} matcher see https://www.wheresrhys.co.uk/fetch-mock/#api-mockingmock_matcher * @param {string[]} keys array of segment keys to fetch * @param {number} changeNumber optional changeNumber */ diff --git a/types/client/index.d.ts b/types/client/index.d.ts index efa3a8f03..d37238859 100644 --- a/types/client/index.d.ts +++ b/types/client/index.d.ts @@ -1,5 +1,5 @@ // Declaration file for JavaScript Split Software SDK -// Project: http://www.split.io/ +// Project: https://www.split.io/ import '@splitsoftware/splitio-commons'; diff --git a/types/index.d.ts b/types/index.d.ts index 159df53d3..1d2c64470 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,5 +1,5 @@ // Declaration file for JavaScript and Node.js Split Software SDK v8.1.0 -// Project: http://www.split.io/ +// Project: https://www.split.io/ // Definitions by: Nico Zelaya /// diff --git a/types/server/index.d.ts b/types/server/index.d.ts index fcbc2bd59..35514aaa1 100644 --- a/types/server/index.d.ts +++ b/types/server/index.d.ts @@ -1,5 +1,5 @@ // Declaration file for JavaScript Split Software SDK -// Project: http://www.split.io/ +// Project: https://www.split.io/ import '@splitsoftware/splitio-commons'; From 76157ca3e9afe378f4660180301a8ebf20ebb4ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 1 Jan 2025 03:14:47 +0000 Subject: [PATCH 2/4] Updated License Year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index c022e9200..df08de3fb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2024 Split Software, Inc. +Copyright © 2025 Split Software, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 8102b8f8ae9b19c1b12fa3ee7695958777373929 Mon Sep 17 00:00:00 2001 From: Melina Urruchua Date: Wed, 8 Jan 2025 12:43:46 -0300 Subject: [PATCH 3/4] Bump artifact actions --- .github/workflows/ci-cd.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index d28295fdb..57a5464ff 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -34,7 +34,7 @@ jobs: run: redis-cli ping - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 'lts/*' cache: 'npm' @@ -59,7 +59,7 @@ jobs: - name: Store assets if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master') }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: assets path: umd/ @@ -81,7 +81,7 @@ jobs: steps: - name: Download assets - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: assets path: umd @@ -91,7 +91,7 @@ jobs: working-directory: umd - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1-node16 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role aws-region: us-east-1 @@ -120,7 +120,7 @@ jobs: steps: - name: Download assets - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: assets path: umd @@ -130,7 +130,7 @@ jobs: working-directory: umd - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1-node16 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role aws-region: us-east-1 From 4f54193d0df5f0886e2ebeb3b2da9c40028471b5 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Thu, 9 Jan 2025 10:16:23 -0300 Subject: [PATCH 4/4] Prepare release v11.0.4 --- CHANGES.txt | 3 +++ package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/settings/defaults/version.js | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 7cd078dd3..dcc52ef76 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +11.0.4 (January 9, 2025) + - Bugfixing - Updated @splitsoftware/splitio-commons package to version 2.0.3, which properly handles rejected promises when using targeting rules with segment matchers in consumer modes (e.g., Redis and Pluggable storages). + 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). diff --git a/package-lock.json b/package-lock.json index a6959f97e..a7b829acb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@splitsoftware/splitio", - "version": "11.0.3", + "version": "11.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio", - "version": "11.0.3", + "version": "11.0.4", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio-commons": "2.0.2", + "@splitsoftware/splitio-commons": "2.0.3", "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.2", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.2.tgz", - "integrity": "sha512-r2m3kwWnSuROT+7zTzhWBrM0DMRBGJNQcTyvXw8zLPPmBs/PnmAnxCy7uRpfMHOGbP9Q3Iju0bU/H5dG8svyiw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.3.tgz", + "integrity": "sha512-weOdbLCBImBD9napQyDdACi35GrKJvh7nYLOYklStJZcNmdSWb7vMk+AFWdKdVjv8Ee23myo6/+1segDiCRJ8g==", "dependencies": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" @@ -7537,9 +7537,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.2.tgz", - "integrity": "sha512-r2m3kwWnSuROT+7zTzhWBrM0DMRBGJNQcTyvXw8zLPPmBs/PnmAnxCy7uRpfMHOGbP9Q3Iju0bU/H5dG8svyiw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.0.3.tgz", + "integrity": "sha512-weOdbLCBImBD9napQyDdACi35GrKJvh7nYLOYklStJZcNmdSWb7vMk+AFWdKdVjv8Ee23myo6/+1segDiCRJ8g==", "requires": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" diff --git a/package.json b/package.json index d62fd35b1..1b7e916f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "11.0.3", + "version": "11.0.4", "description": "Split SDK", "files": [ "README.md", @@ -38,7 +38,7 @@ "node": ">=14.0.0" }, "dependencies": { - "@splitsoftware/splitio-commons": "2.0.2", + "@splitsoftware/splitio-commons": "2.0.3", "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 c1fb40805..563a20863 100644 --- a/src/settings/defaults/version.js +++ b/src/settings/defaults/version.js @@ -1 +1 @@ -export const packageVersion = '11.0.3'; +export const packageVersion = '11.0.4';