From 7a2b279da16f6f8a25c93da2fcf126d1a58857ba Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Mon, 28 Aug 2023 14:47:12 -0300 Subject: [PATCH 1/4] export client identities (key and trafficType) to support Suite implementation --- package-lock.json | 4 ++-- package.json | 2 +- src/sdkClient/clientCS.ts | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8b4a82b5..b345dd22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-commons", - "version": "1.9.0", + "version": "1.9.1-rc.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-commons", - "version": "1.9.0", + "version": "1.9.1-rc.0", "license": "Apache-2.0", "dependencies": { "tslib": "^2.3.1" diff --git a/package.json b/package.json index 1e0e5d5a..543c6582 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-commons", - "version": "1.9.0", + "version": "1.9.1-rc.0", "description": "Split Javascript SDK common components", "main": "cjs/index.js", "module": "esm/index.js", diff --git a/src/sdkClient/clientCS.ts b/src/sdkClient/clientCS.ts index c66d1e04..3d33876b 100644 --- a/src/sdkClient/clientCS.ts +++ b/src/sdkClient/clientCS.ts @@ -25,6 +25,9 @@ export function clientCSDecorator(log: ILogger, client: SplitIO.IClient, key: Sp // Key is bound to the `track` method. Same thing happens with trafficType but only if provided track: trafficType ? clientCS.track.bind(clientCS, key, trafficType) : clientCS.track.bind(clientCS, key), - isClientSide: true + // Not part of the public API. These properties are used to support other modules (e.g., Split Suite) + isClientSide: true, + key, + trafficType }) as SplitIO.ICsClient; } From 6997560bfff25e508cd218c0eac1b067c836b7d3 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 10 Oct 2023 13:24:29 -0300 Subject: [PATCH 2/4] update log message --- src/logger/messages/info.ts | 2 +- src/storages/inMemory/TelemetryCacheInMemory.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/logger/messages/info.ts b/src/logger/messages/info.ts index a7b62171..907c9fc7 100644 --- a/src/logger/messages/info.ts +++ b/src/logger/messages/info.ts @@ -1,7 +1,7 @@ import * as c from '../constants'; import { codesWarn } from './warn'; -const READY_MSG = 'Split SDK is ready'; +const READY_MSG = 'Split SDK client is ready'; export const codesInfo: [number, string][] = codesWarn.concat([ // client status diff --git a/src/storages/inMemory/TelemetryCacheInMemory.ts b/src/storages/inMemory/TelemetryCacheInMemory.ts index c4ae5131..d3d3030f 100644 --- a/src/storages/inMemory/TelemetryCacheInMemory.ts +++ b/src/storages/inMemory/TelemetryCacheInMemory.ts @@ -50,6 +50,7 @@ export class TelemetryCacheInMemory implements ITelemetryCacheSync { iDr: this.getImpressionStats(DROPPED), spC: this.splits && this.splits.getSplitNames().length, seC: this.segments && this.segments.getRegisteredSegments().length, + // @TODO number of clients in client-side API? skC: this.segments && this.segments.getKeysCount(), sL: this.getSessionLength(), eQ: this.getEventStats(QUEUED), From c33449de2f65d32d198413a01414a1a2dde27dc3 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 10 Oct 2023 13:27:00 -0300 Subject: [PATCH 3/4] prepare rc --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1adf8a91..6c925fb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-commons", - "version": "1.9.1-rc.0", + "version": "1.9.2-rc.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-commons", - "version": "1.9.1-rc.0", + "version": "1.9.2-rc.2", "license": "Apache-2.0", "dependencies": { "tslib": "^2.3.1" diff --git a/package.json b/package.json index efe8fea2..edd98b5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-commons", - "version": "1.9.1-rc.0", + "version": "1.9.2-rc.2", "description": "Split Javascript SDK common components", "main": "cjs/index.js", "module": "esm/index.js", From 8e5535044934411674f24de51fc7bceec1fa185b Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 10 Oct 2023 13:51:29 -0300 Subject: [PATCH 4/4] update comments --- src/storages/AbstractSegmentsCacheSync.ts | 1 + src/storages/inMemory/TelemetryCacheInMemory.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storages/AbstractSegmentsCacheSync.ts b/src/storages/AbstractSegmentsCacheSync.ts index 23b3a491..a3780d48 100644 --- a/src/storages/AbstractSegmentsCacheSync.ts +++ b/src/storages/AbstractSegmentsCacheSync.ts @@ -44,6 +44,7 @@ export abstract class AbstractSegmentsCacheSync implements ISegmentsCacheSync { /** * Only used for the `skC`(segment keys count) telemetry stat: 1 for client-side, and total count of keys in server-side. + * @TODO for client-side it should be the number of clients, but it requires a refactor of MySegments caches to simplify the code. */ abstract getKeysCount(): number diff --git a/src/storages/inMemory/TelemetryCacheInMemory.ts b/src/storages/inMemory/TelemetryCacheInMemory.ts index d9d7ae74..26fb2b17 100644 --- a/src/storages/inMemory/TelemetryCacheInMemory.ts +++ b/src/storages/inMemory/TelemetryCacheInMemory.ts @@ -50,7 +50,6 @@ export class TelemetryCacheInMemory implements ITelemetryCacheSync { iDr: this.getImpressionStats(DROPPED), spC: this.splits && this.splits.getSplitNames().length, seC: this.segments && this.segments.getRegisteredSegments().length, - // @TODO number of clients in client-side API? skC: this.segments && this.segments.getKeysCount(), sL: this.getSessionLength(), eQ: this.getEventStats(QUEUED),