Skip to content

Commit

Permalink
Merge pull request #800 from splitio/fix_typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
EmilianoSanchez committed Apr 12, 2024
2 parents 45b7980 + a678e26 commit 282b560
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 31 deletions.
22 changes: 11 additions & 11 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
- Bugfixing - Fixed an issue with `connectionTimeout` options params of Redis storage, that was being ignored and not passed down to the underlying ioredis client.
- Bugfixing - Updated the validation of some SDK configuration params to log errors and throw exceptions with clear descriptions of the invalid setup:
- If passing a non-string value to `sync.impressionsMode`, the SDK logs the error: "you passed an invalid impressionsMode config param. It should be one of the following values: 'OPTIMIZED', 'DEBUG'. Defaulting to 'OPTIMIZED'.".
- If passing 'REDIS' storage type without setting `mode` to 'consumer', the SDK logs the error: "The provided REDIS storage is invalid for this mode. It requires 'consumer' mode. Fallbacking into default MEMORY storage.".
- If passing 'REDIS' storage type without setting `mode` to 'consumer', the SDK logs the error: "The provided REDIS storage is invalid for this mode. It requires 'consumer' mode. Fallback into default MEMORY storage.".
- If passing 'consumer' mode without setting `storage.type` to 'REDIS', the SDK throws an exception with message: "A REDIS storage is required on consumer mode.".

- NOTABLE CHANGE: since version 10.18.0, the SDK has been refactored to use @splitsoftware/splitio-commons package in order to reuse core modules shared across all JavaScript-based SDKs. Most internal modules have been moved and renamed,
Expand Down Expand Up @@ -175,7 +175,7 @@
10.15.4 (Mar 17, 2021)
- Updated Streaming logic with some improvements and fixes, including:
- Updated SSE error handling.
- Extended publishers tracking to support multiregion infrastructure.
- Extended publishers tracking to support multi-region infrastructure.
- Enforced revalidation for requests stored in local caches, like proxies or browsers.
- Bugfixing - In NodeJS, fetch new segments captured due to streaming notifications.
- Updated some dependencies, including a vulnerability fix.
Expand Down Expand Up @@ -300,11 +300,11 @@
- Added Block Until Ready functionality support for consumer clients (Redis mode on Node) to make integration code work the same between modes.
- Added more Input and Usage Validation rules, including an extra label for impressions when the SDK is not ready.
- Updated the SDK Redis adapter to handle pending commands when disconnecting from the Redis server.
- Bugfixing - Clearing up readyTimeout after we don't need it anymore. It also fixes the missleading SDK_READY_TIMED_OUT error log when using Redis.
- Bugfixing - Clearing up readyTimeout after we don't need it anymore. It also fixes the misleading SDK_READY_TIMED_OUT error log when using Redis.

10.7.0 (Apr 30, 2019)
- Added Block Until Ready functionality to the manager, shared with the main client. Now you can subscribe to SDK events or use the .ready() promise from the manager as well.
- Added Dynamic Configurations support through two new methods that mimick the regular ones, changing the type of what is returned.
- Added Dynamic Configurations support through two new methods that mimic the regular ones, changing the type of what is returned.
- getTreatmentWithConfig: Same as getTreatment, but instead of a string it returns a map with treatment and config as a stringified JSON.
- getTreatmentWithConfig: Same as getTreatments, but instead of a map of string it returns a map of objects with treatment and config as a stringified JSON.
- Added configs to SplitViews returned by the manager module.
Expand All @@ -318,7 +318,7 @@

10.6.0 (Feb 12, 2019)
- BREAKING CHANGE: Updated impressions cache for Redis storage to reduce the amount of Redis operations by using a single queue (Must use Synchronizer 2.x or above with this or newer SDK versions).
- Added stricter validations to the input of the SDK api to provide better and faster feedback in case of missuse. We want our users to be able to diagnose issues sooner,
- Added stricter validations to the input of the SDK api to provide better and faster feedback in case of misuse. We want our users to be able to diagnose issues sooner,
instead of when you can't find the data you're looking for. As part of this, some error logs (just logs) will be visible even with the SDK Logger disabled.
- Updated getTreatments to have it's own latency metric for the whole operation, instead of one per each feature evaluation.
- Updated default values on configuration for NodeJS.
Expand Down Expand Up @@ -385,13 +385,13 @@
- Migrated source code to es modules.
- Localhost mode uses fewer dependencies now.
- Removed flowtype since it was not used anymore.
- Udpated to last node LTS.
- Updated to last node LTS.
- Added package-lock.json.
- Fixed eslint configuration.

9.4.0 (Jan 12, 2018)
- Adding support for client.track method, for tracking custom events.
- Adding trafficType as an optional core setting. If provided on the browser it will be binded to the client as the key.
- Adding trafficType as an optional core setting. If provided on the browser it will be bound to the client as the key.
- TypeScript declarations polishing.
- Updated SDK labels.
- Bugfixing - Shared clients (browser) were ready even if the main client was not.
Expand Down Expand Up @@ -593,10 +593,10 @@ var treatmentsMap = client.getTreatments('CUSTOMER_KEY', ['Feature_flag_1', 'Fea
const client = SplitFactory(config);

// Redis in NodeJS is async so we can use async/await syntax
const treatment = await client.getTreatment('my-feature-comming-from-localstorage');
const treatment = await client.getTreatment('my-feature-coming-from-localstorage');

// or just use the returned promise
client.getTreatment('my-feature-comming-from-localstorage').then(treatment => {
client.getTreatment('my-feature-coming-from-localstorage').then(treatment => {
// do something with the treatment
});
```
Expand Down Expand Up @@ -652,7 +652,7 @@ var treatmentsMap = client.getTreatments('CUSTOMER_KEY', ['Feature_flag_1', 'Fea

client.getTreatment('my_feature') === 'on'; // true

factory.settings.features.my_feature = 'off'; // Apply this cache programatically
factory.settings.features.my_feature = 'off'; // Apply this cache programmatically

client.getTreatment('my_feature') === 'off'; // Some time after you will be able to verify this
```
Expand Down Expand Up @@ -728,7 +728,7 @@ var treatmentsMap = client.getTreatments('CUSTOMER_KEY', ['Feature_flag_1', 'Fea
```html
<script src="//cdn.split.io/sdk/split-5.0.0.min.js"></script>
<script>
// instanciation
// instantiation
var dynamic1 = splitio({
core: {
authorizationKey: '<your-token>',
Expand Down
12 changes: 6 additions & 6 deletions src/__tests__/browserSuites/events.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function withoutBindingTT(fetchMock, assert) {
assert.ok(client.track, 'client.track should be defined.');
assert.equal(typeof client.track, 'function', 'client.track should be a function.');

// Key binded as with getTreatment.
// Key bound as with getTreatment.
tsStart = Date.now();
assert.ok(client.track('sometraffictype', 'someEvent', 10), 'client.track returns true if an event is added to the queue.');
assert.ok(client.track('othertraffictype', 'genericEvent', 25), 'client.track returns true if event value is null and is added to the queue.');
Expand All @@ -96,7 +96,7 @@ export function withoutBindingTT(fetchMock, assert) {
// Not for JS Browser SDK, because it doesn't let bind traffic types to clients
export function bindingTT(fetchMock, assert) {
const localSettings = Object.assign({}, baseSettings);
localSettings.core.trafficType = 'binded_tt';
localSettings.core.trafficType = 'bound_tt';
const splitio = SplitFactory(localSettings);
const client = splitio.client();

Expand All @@ -113,20 +113,20 @@ export function bindingTT(fetchMock, assert) {

assert.equal(firstEvent.key, 'facundo@split.io', 'Key should match received value.');
assert.equal(firstEvent.eventTypeId, 'someEvent', 'EventTypeId should match received value.');
assert.equal(firstEvent.trafficTypeName, 'binded_tt', 'TrafficTypeName should match the binded value.');
assert.equal(firstEvent.trafficTypeName, 'bound_tt', 'TrafficTypeName should match the bound value.');
assert.equal(firstEvent.value, 10, 'Value should match the value received on the .track() function.');
assert.equal(typeof firstEvent.timestamp, 'number', 'The timestamp should be a number.');

assert.equal(midEvent.key, 'facundo@split.io', 'Key should match received value.');
assert.equal(midEvent.eventTypeId, 'genericEvent', 'EventTypeId should match received value.');
assert.equal(midEvent.trafficTypeName, 'binded_tt', 'TrafficTypeName should match received value in lowercases.');
assert.equal(midEvent.trafficTypeName, 'bound_tt', 'TrafficTypeName should match received value in lowercases.');
assert.equal(midEvent.value, 24, 'Value should match the value received on the .track() function.');
assert.true(midEvent.timestamp >= tsStart && midEvent.timestamp <= tsEnd, 'The timestamp should be a number with the right value.');
assert.deepEqual(midEvent.properties, { prop1: true, prop2: 'a', prop3: 2, prop4: null, willBeNulled: null }, 'The properties should be correct.');

assert.equal(lastEvent.key, 'facundo@split.io', 'Key should match received value.');
assert.equal(lastEvent.eventTypeId, 'my.checkout.event', 'EventTypeId should match received value.');
assert.equal(lastEvent.trafficTypeName, 'binded_tt', 'TrafficTypeName should match the binded value.');
assert.equal(lastEvent.trafficTypeName, 'bound_tt', 'TrafficTypeName should match the bound value.');
assert.equal(lastEvent.value, null, 'Should have null as value.');
assert.equal(typeof lastEvent.timestamp, 'number', 'The timestamp should be a number.');

Expand All @@ -139,7 +139,7 @@ export function bindingTT(fetchMock, assert) {
assert.ok(client.track, 'client.track should be defined.');
assert.equal(typeof client.track, 'function', 'client.track should be a function.');

// Key binded as with getTreatment.
// Key bound as with getTreatment.
tsStart = Date.now();
assert.ok(client.track('someEvent', 10), 'client.track returns true if an event is added to the queue.');
assert.ok(client.track('genericEvent', 25), 'client.track returns true if an event is added to the queue');
Expand Down
14 changes: 7 additions & 7 deletions src/__tests__/browserSuites/shared-instantiation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ export default function sharedInstantiationSuite(startWithTT, sdkIgnoresTT, fetc
const events = JSON.parse(opts.body);

assert.equal(events.length, sdkIgnoresTT ? 2 : 3, 'Tracked only valid events');
assert.equal(events[0].trafficTypeName, `${startWithTT && !sdkIgnoresTT ? 'start' : 'main'}_tt`, 'matching traffic types both binded and provided through client.track()');
assert.equal(events[1].trafficTypeName, 'marcio_tt', 'matching traffic types both binded and provided through client.track()');
if (!sdkIgnoresTT) assert.equal(events[2].trafficTypeName, 'nico_tt', 'matching traffic types both binded and provided through client.track()');
assert.equal(events[0].trafficTypeName, `${startWithTT && !sdkIgnoresTT ? 'start' : 'main'}_tt`, 'matching traffic type provided through client.track()');
assert.equal(events[1].trafficTypeName, 'marcio_tt', 'matching traffic type provided through client.track()');
if (!sdkIgnoresTT) assert.equal(events[2].trafficTypeName, 'nico_tt', 'matching traffic type provided through client.track()');

finished.next();

Expand All @@ -124,14 +124,14 @@ export default function sharedInstantiationSuite(startWithTT, sdkIgnoresTT, fetc
}

// Shared instance without TT on instantiation
assert.false(marcioClient.track('marcioEvent'), 'If a shared client was created passing only key, no traffic type is binded so we need to provide one for client.track()');
assert.true(marcioClient.track('marcio_tt', 'marcioEvent', 10), 'If a shared client was created passing only key, no traffic type is binded so we need to provide one for client.track()');
assert.false(marcioClient.track('marcioEvent'), 'If a shared client was created passing only key, no traffic type is bound so we need to provide one for client.track()');
assert.true(marcioClient.track('marcio_tt', 'marcioEvent', 10), 'If a shared client was created passing only key, no traffic type is bound so we need to provide one for client.track()');

// Shared instance with TT on instantiation
if (sdkIgnoresTT) {
assert.false(nicolasClient.track('nicoEvent', 10), 'If a shared client was created passing both key and TT but the SDK ignores TT, the latter doesn\'t get binded to it so it is necessary to provide the traffic type to client.track()');
assert.false(nicolasClient.track('nicoEvent', 10), 'If a shared client was created passing both key and TT but the SDK ignores TT, the latter doesn\'t get bound to it so it is necessary to provide the traffic type to client.track()');
} else {
assert.true(nicolasClient.track('nicoEvent', 10), 'If a shared client was created passing both key and TT, the latter gets binded to it so it is not necessary to provide the traffic type to client.track()');
assert.true(nicolasClient.track('nicoEvent', 10), 'If a shared client was created passing both key and TT, the latter gets bound to it so it is not necessary to provide the traffic type to client.track()');
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/browserSuites/use-beacon-api.debug.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const assertImpressionSent = (assert, impression) => {
const assertEventSent = (assert, event) => {
assert.equal(event.key, 'facundo@split.io', 'Key should match received value.');
assert.equal(event.eventTypeId, 'someEvent', 'EventTypeId should match received value.');
assert.equal(event.trafficTypeName, 'sometraffictype', 'TrafficTypeName should match the binded value.');
assert.equal(event.trafficTypeName, 'sometraffictype', 'TrafficTypeName should match the bound value.');
};

const assertCallsToBeaconAPI = (assert) => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/browserSuites/use-beacon-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const assertImpressionSent = (assert, impression) => {
const assertEventSent = (assert, event) => {
assert.equal(event.key, 'facundo@split.io', 'Key should match received value.');
assert.equal(event.eventTypeId, 'someEvent', 'EventTypeId should match received value.');
assert.equal(event.trafficTypeName, 'sometraffictype', 'TrafficTypeName should match the binded value.');
assert.equal(event.trafficTypeName, 'sometraffictype', 'TrafficTypeName should match the bound value.');
};

const assertImpressionsCountSent = (assert, impressionCount) => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/nodeSuites/events.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function trackAssertions(fetchMock, assert) {
assert.equal(typeof client.track, 'function', 'client.track should be a function.');

tsStart = Date.now();
// Key binded as with getTreatment.
// Key bound as with getTreatment.
assert.ok(client.track('nicolas@split.io', 'sometraffictype', 'someEvent', 10), 'client.track returns true if an event is added to the queue.');
assert.ok(client.track('nicolas@split.io', 'othertraffictype', 'genericEvent', 25), 'client.track returns true if event value is null and is added to the queue.');
assert.ok(client.track('nicolas@split.io', 'othertraffictype', 'genericEvent', 25, null), 'client.track returns true if event properties is null and is added to the queue.');
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/online/browser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ tape('## E2E CI Tests ##', function (assert) {
assert.test('E2E / Telemetry', telemetrySuite.bind(null, fetchMock));
/* Check events */
assert.test('E2E / Events', withoutBindingTT.bind(null, fetchMock));
assert.test('E2E / Events with TT binded', bindingTT.bind(null, fetchMock));
assert.test('E2E / Events with TT bound', bindingTT.bind(null, fetchMock));
/* Check shared clients */
assert.test('E2E / Shared instances', sharedInstantiationSuite.bind(null, false, false, fetchMock));
assert.test('E2E / Shared instances with Traffic Type on factory settings', sharedInstantiationSuite.bind(null, true, false, fetchMock));
Expand Down
6 changes: 3 additions & 3 deletions ts-tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ treatmentsWithConfig = client.getTreatmentsWithConfigByFlagSets(['set_a']);
treatmentsWithConfig = client.getTreatmentsWithConfigByFlagSets(splitKey, ['set_a'], attributes);
treatmentsWithConfig = client.getTreatmentsWithConfigByFlagSets(['set_a'], attributes);

// We can call track with or without a key. Traffic type can also be binded to the client.
// We can call track with or without a key. Traffic type can also be bound to the client.
tracked = client.track(splitKey, 'myTrafficType', 'myEventType'); // all params
tracked = client.track('myTrafficType', 'myEventType'); // key binded, tt provided.
tracked = client.track('myEventType'); // key and tt binded.
tracked = client.track('myTrafficType', 'myEventType'); // key bound, tt provided.
tracked = client.track('myEventType'); // key and tt bound.
// Value parameter is optional on all signatures.
tracked = client.track(splitKey, 'myTrafficType', 'myEventType', 10);
tracked = client.track('myTrafficType', 'myEventType', 10);
Expand Down

0 comments on commit 282b560

Please sign in to comment.