From 44cae6ac0a71f1ddf294fa134a3ef85f309faa7a Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Mon, 18 Jul 2022 18:00:14 -0300 Subject: [PATCH 01/13] update push e2e tests --- CHANGES.txt | 2 +- package-lock.json | 8 ++++---- package.json | 4 ++-- src/__tests__/online/impressions.debug.spec.js | 10 +++++----- src/__tests__/online/impressions.spec.js | 7 +++---- .../push/push-synchronization-retries.spec.js | 7 +++---- src/settings/defaults.ts | 2 +- 7 files changed, 19 insertions(+), 21 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index dbd4783..48d7581 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,7 +2,7 @@ - Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config sync.enabled . Running online Split will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used. - Updated telemetry logic to track the anonymous config for user consent flag set to declined or unknown. - Updated submitters logic, to avoid duplicating the post of impressions to Split cloud when the SDK is destroyed while its periodic post of impressions is running. - +- Bugfixing - Updated submitters logic, to avoid dropping impressions and events that are being tracked while POST request is pending. 0.6.0 (May 24, 2022) - Added `scheduler.telemetryRefreshRate` property to SDK configuration. diff --git a/package-lock.json b/package-lock.json index 4d71935..956b0c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-browserjs", - "version": "0.7.0", + "version": "0.7.1-rc.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2184,9 +2184,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.5.0.tgz", - "integrity": "sha512-7vBv4Yn+EKaAxJ+9RdKOqJNee+izj6BieG0ZmivWk8fTpKFpcvqKes/Y0kXk0tfOiMmUFV9dRr2xDHRYIf0lnw==", + "version": "1.5.1-rc.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.5.1-rc.1.tgz", + "integrity": "sha512-NeVreo+igjYrlcWPq0gMEyE6QTxSv906S96X1XmibP/vcJFS90E9Vbr4GAAZKxrV0qh2FC5nMoGtYD7T4nhlhQ==", "requires": { "tslib": "^2.3.1" } diff --git a/package.json b/package.json index 2bcb82d..320c1a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-browserjs", - "version": "0.7.0", + "version": "0.7.1-rc.0", "description": "Split SDK for Javascript on Browser", "main": "cjs/index.js", "module": "esm/index.js", @@ -61,7 +61,7 @@ "bugs": "https://github.com/splitio/javascript-browser-client/issues", "homepage": "https://github.com/splitio/javascript-browser-client#readme", "dependencies": { - "@splitsoftware/splitio-commons": "1.5.0", + "@splitsoftware/splitio-commons": "1.5.1-rc.1", "@types/google.analytics": "0.0.40" }, "devDependencies": { diff --git a/src/__tests__/online/impressions.debug.spec.js b/src/__tests__/online/impressions.debug.spec.js index acba537..ba8fa8a 100644 --- a/src/__tests__/online/impressions.debug.spec.js +++ b/src/__tests__/online/impressions.debug.spec.js @@ -7,8 +7,8 @@ import { DEBUG } from '@splitsoftware/splitio-commons/src/utils/constants'; import { url } from '../testUtils'; const baseUrls = { - sdk: 'https://sdk.baseurl/impressionsSuite', - events: 'https://events.baseurl/impressionsSuite' + sdk: 'https://sdk.baseurl/impressionsDebugSuite', + events: 'https://events.baseurl/impressionsDebugSuite' }; const settings = settingsValidator({ @@ -83,12 +83,12 @@ export default function (fetchMock, assert) { assert.equal(req.headers.SplitSDKImpressionsMode, DEBUG); assertPayload(req); - client.destroy(); - assert.end(); + client.destroy().then(() => { + assert.end(); + }); return 200; }); - fetchMock.postOnce(url(settings, '/testImpressions/bulk'), 200); client.ready().then(() => { client.getTreatment('split_with_config'); diff --git a/src/__tests__/online/impressions.spec.js b/src/__tests__/online/impressions.spec.js index 2f02e2d..1f2f71d 100644 --- a/src/__tests__/online/impressions.spec.js +++ b/src/__tests__/online/impressions.spec.js @@ -84,12 +84,12 @@ export default function (fetchMock, assert) { assert.comment('We do one retry, so after a failed impressions post we will try once more.'); assertPayload(req); - client.destroy(); - assert.end(); + client.destroy().then(() => { + assert.end(); + }); return 200; }); - fetchMock.postOnce(url(settings, '/testImpressions/bulk'), 200); fetchMock.postOnce(url(settings, '/testImpressions/count'), (url, opts) => { const data = JSON.parse(opts.body); @@ -109,7 +109,6 @@ export default function (fetchMock, assert) { return 200; }); - fetchMock.postOnce(url(settings, '/testImpressions/count'), 200); client.ready().then(() => { truncatedTimeFrame = truncateTimeFrame(Date.now()); diff --git a/src/__tests__/push/push-synchronization-retries.spec.js b/src/__tests__/push/push-synchronization-retries.spec.js index 04ae3fc..c106710 100644 --- a/src/__tests__/push/push-synchronization-retries.spec.js +++ b/src/__tests__/push/push-synchronization-retries.spec.js @@ -74,9 +74,8 @@ const MILLIS_THIRD_RETRY_FOR_SPLIT_KILL_EVENT = 2000; * (we destroy the client here, to assert that all scheduled tasks are clean) */ export function testSynchronizationRetries(fetchMock, assert) { - // we update the backoff default base, to reduce the time of the test - const ORIGINAL_DEFAULT_BASE_MILLIS = Backoff.DEFAULT_BASE_MILLIS; - Backoff.DEFAULT_BASE_MILLIS = 100; + // Force the backoff base of UpdateWorkers, from 10 secs to 100 ms, to reduce test time + Backoff.__TEST__BASE_MILLIS = 100; assert.plan(17); fetchMock.reset(); @@ -194,7 +193,7 @@ export function testSynchronizationRetries(fetchMock, assert) { setTimeout(() => { Promise.all([otherClientSync.destroy(), client.destroy()]).then(() => { assert.equal(client.getTreatment('whitelist'), 'control', 'evaluation returns control if client is destroyed'); - Backoff.DEFAULT_BASE_MILLIS = ORIGINAL_DEFAULT_BASE_MILLIS; + Backoff.__TEST__BASE_MILLIS = undefined; assert.end(); }); }); diff --git a/src/settings/defaults.ts b/src/settings/defaults.ts index e27849d..4225aeb 100644 --- a/src/settings/defaults.ts +++ b/src/settings/defaults.ts @@ -2,7 +2,7 @@ import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/ import { ConsentStatus, LogLevel } from '@splitsoftware/splitio-commons/src/types'; import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants'; -const packageVersion = '0.7.0'; +const packageVersion = '0.7.1-rc.0'; /** * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item. From 9ca45e2f95bee5bfa3bb04a46222cc4337b7e217 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Mon, 18 Jul 2022 18:11:24 -0300 Subject: [PATCH 02/13] update online e2e tests --- src/__tests__/online/browser.spec.js | 6 ++--- .../online/use-beacon-api.debug.spec.js | 23 +++++++++-------- src/__tests__/online/use-beacon-api.spec.js | 25 +++++++++++-------- src/__tests__/online/user-consent.spec.js | 6 ++--- src/__tests__/testUtils/index.js | 20 ++++++++++++--- 5 files changed, 48 insertions(+), 32 deletions(-) diff --git a/src/__tests__/online/browser.spec.js b/src/__tests__/online/browser.spec.js index cd07831..95f48bd 100644 --- a/src/__tests__/online/browser.spec.js +++ b/src/__tests__/online/browser.spec.js @@ -119,9 +119,9 @@ tape('## E2E CI Tests ##', function (assert) { assert.test('E2E / Readiness', readinessSuite.bind(null, fetchMock)); /* Validate headers for ip and hostname are not sended with requests (ignore setting IPAddressesEnabled) */ assert.test('E2E / Ignore setting IPAddressesEnabled', ignoreIpAddressesSettingSuite.bind(null, fetchMock)); - /* Check that impressions and events are sended to backend via Beacon API or Fetch when page unload is triggered. */ - assert.test('E2E / Use Beacon API (or Fetch if not available) to send remaining impressions and events when browser page is unload', useBeaconApiSuite.bind(null, fetchMock)); - assert.test('E2E / Use Beacon API DEBUG (or Fetch if not available) to send remaining impressions and events when browser page is unload', useBeaconDebugApiSuite.bind(null, fetchMock)); + /* Check that impressions and events are sended to backend via Beacon API or Fetch when pagehide/visibilitychange events are triggered. */ + assert.test('E2E / Use Beacon API (or Fetch if not available) to send remaining impressions and events when browser page is unload or hidden', useBeaconApiSuite.bind(null, fetchMock)); + assert.test('E2E / Use Beacon API DEBUG (or Fetch if not available) to send remaining impressions and events when browser page is unload or hidden', useBeaconDebugApiSuite.bind(null, fetchMock)); /* Validate ready from cache behaviour (might be merged into another suite if we end up having simple behavior around it as expected) */ assert.test('E2E / Readiness from cache', readyFromCache.bind(null, fetchMock)); /* Validate readiness with ready promises */ diff --git a/src/__tests__/online/use-beacon-api.debug.spec.js b/src/__tests__/online/use-beacon-api.debug.spec.js index a90e0f8..2b11880 100644 --- a/src/__tests__/online/use-beacon-api.debug.spec.js +++ b/src/__tests__/online/use-beacon-api.debug.spec.js @@ -4,7 +4,7 @@ import { settingsValidator } from '../../settings'; import splitChangesMock1 from '../mocks/splitchanges.since.-1.json'; import mySegmentsFacundo from '../mocks/mysegments.facundo@split.io.json'; import { DEBUG } from '@splitsoftware/splitio-commons/src/utils/constants'; -import { url, triggerUnloadEvent } from '../testUtils'; +import { url, triggerPagehideEvent, triggerVisibilitychange } from '../testUtils'; const config = { core: { @@ -60,7 +60,7 @@ const assertCallsToBeaconAPI = (assert) => { assertEventSent(assert, parsedPayload.entries[0]); }; -// This E2E test checks that Beacon API is not called when page unload is triggered and there are not events or impressions to send. +// This E2E test checks that Beacon API is not called when page is hidden and there are not events or impressions to send. function beaconApiNotSendTestDebug(fetchMock, assert) { sendBeaconSpyDebug = sinon.spy(window.navigator, 'sendBeacon'); @@ -74,8 +74,9 @@ function beaconApiNotSendTestDebug(fetchMock, assert) { const client = splitio.client(); client.on(client.Event.SDK_READY, () => { - // trigger unload event, without tracked events and impressions - triggerUnloadEvent(); + // trigger events, without tracked events and impressions + triggerPagehideEvent(); + triggerVisibilitychange(); // destroy the client and execute the next E2E test named beaconApiSendTest setTimeout(() => { @@ -89,7 +90,7 @@ function beaconApiNotSendTestDebug(fetchMock, assert) { }); } -// This E2E test checks that impressions and events are sent to backend via Beacon API when page unload is triggered. +// This E2E test checks that impressions and events are sent to backend via Beacon API when page is hidden. function beaconApiSendTestDebug(fetchMock, assert) { // Init and run Split client @@ -99,8 +100,8 @@ function beaconApiSendTestDebug(fetchMock, assert) { client.getTreatment('hierarchical_splits_test'); client.track('sometraffictype', 'someEvent', 10); - // trigger unload event inmmediatly, before scheduled push of events and impressions - triggerUnloadEvent(); + // trigger visibilitychange event inmmediatly, before scheduled push of events and impressions + triggerVisibilitychange(); // queue the assertion of the Beacon requests, destroy the client and execute the next E2E test named fallbackTest setTimeout(() => { @@ -114,7 +115,7 @@ function beaconApiSendTestDebug(fetchMock, assert) { }); } -// This E2E test checks that impressions and events are sent to backend via Axios when page unload is triggered and Beacon API is not available. +// This E2E test checks that impressions and events are sent to backend via Fetch API when page is hidden and Beacon API is not available. function fallbackTest(fetchMock, assert) { // destroy reference to Beacon API @@ -134,7 +135,7 @@ function fallbackTest(fetchMock, assert) { }, 0); })(); - // Mock endpoints used by Axios + // Mock endpoints fetchMock.postOnce(url(settings, '/testImpressions/bulk'), (url, opts) => { const resp = JSON.parse(opts.body); assert.ok(opts, 'Fallback to /testImpressions/bulk'); @@ -153,8 +154,8 @@ function fallbackTest(fetchMock, assert) { client.on(client.Event.SDK_READY, () => { client.getTreatment('hierarchical_splits_test'); client.track('sometraffictype', 'someEvent', 10); - // trigger unload event inmmediatly, before scheduled push of events and impressions - triggerUnloadEvent(); + // trigger pagehide event inmmediatly, before scheduled push of events and impressions + triggerPagehideEvent(); }); } diff --git a/src/__tests__/online/use-beacon-api.spec.js b/src/__tests__/online/use-beacon-api.spec.js index d84344a..d09102c 100644 --- a/src/__tests__/online/use-beacon-api.spec.js +++ b/src/__tests__/online/use-beacon-api.spec.js @@ -3,7 +3,7 @@ import { SplitFactory } from '../../index'; import { settingsValidator } from '../../settings'; import splitChangesMock1 from '../mocks/splitchanges.since.-1.json'; import mySegmentsFacundo from '../mocks/mysegments.facundo@split.io.json'; -import { url, triggerUnloadEvent } from '../testUtils'; +import { url, triggerPagehideEvent, triggerVisibilitychange } from '../testUtils'; import { OPTIMIZED } from '@splitsoftware/splitio-commons/src/utils/constants'; const config = { @@ -72,7 +72,7 @@ const assertCallsToBeaconAPI = (assert) => { assertImpressionsCountSent(assert, parsedPayload.entries); }; -// This E2E test checks that Beacon API is not called when page unload is triggered and there are not events or impressions to send. +// This E2E test checks that Beacon API is not called when page is hidden and there are not events or impressions to send. function beaconApiNotSendTest(fetchMock, assert) { sendBeaconSpy = sinon.spy(window.navigator, 'sendBeacon'); @@ -86,8 +86,9 @@ function beaconApiNotSendTest(fetchMock, assert) { const client = splitio.client(); client.on(client.Event.SDK_READY, () => { - // trigger unload event, without tracked events and impressions - triggerUnloadEvent(); + // trigger events, without tracked events and impressions + triggerPagehideEvent(); + triggerVisibilitychange(); // destroy the client and execute the next E2E test named beaconApiSendTest setTimeout(() => { @@ -101,7 +102,7 @@ function beaconApiNotSendTest(fetchMock, assert) { }); } -// This E2E test checks that impressions and events are sent to backend via Beacon API when page unload is triggered. +// This E2E test checks that impressions and events are sent to backend via Beacon API when page is hidden. function beaconApiSendTest(fetchMock, assert) { // Init and run Split client @@ -111,8 +112,9 @@ function beaconApiSendTest(fetchMock, assert) { client.getTreatment('hierarchical_splits_test'); client.track('sometraffictype', 'someEvent', 10); - // trigger unload event inmmediatly, before scheduled push of events and impressions - triggerUnloadEvent(); + // trigger both events inmmediatly, before scheduled push of events and impressions, to assert that beacon requests are not duplicated + triggerPagehideEvent(); + triggerVisibilitychange(); // queue the assertion of the Beacon requests, destroy the client and execute the next E2E test named fallbackTest setTimeout(() => { @@ -126,7 +128,7 @@ function beaconApiSendTest(fetchMock, assert) { }); } -// This E2E test checks that impressions and events are sent to backend via Axios when page unload is triggered and Beacon API is not available. +// This E2E test checks that impressions and events are sent to backend via Fetch API when page is hidden and Beacon API is not available. function fallbackTest(fetchMock, assert) { // destroy reference to Beacon API @@ -147,7 +149,7 @@ function fallbackTest(fetchMock, assert) { }, 0); })(); - // Mock endpoints used by Axios + // Mock endpoints fetchMock.postOnce(url(settings, '/testImpressions/bulk'), (url, opts) => { const resp = JSON.parse(opts.body); assert.ok(opts, 'Fallback to /testImpressions/bulk'); @@ -173,8 +175,9 @@ function fallbackTest(fetchMock, assert) { client.on(client.Event.SDK_READY, () => { client.getTreatment('hierarchical_splits_test'); client.track('sometraffictype', 'someEvent', 10); - // trigger unload event inmmediatly, before scheduled push of events and impressions - triggerUnloadEvent(); + // trigger both events inmmediatly, before scheduled push of events and impressions, to assert that POST requests are not duplicated + triggerPagehideEvent(); + triggerVisibilitychange(); }); } diff --git a/src/__tests__/online/user-consent.spec.js b/src/__tests__/online/user-consent.spec.js index b351d13..ef4fbd7 100644 --- a/src/__tests__/online/user-consent.spec.js +++ b/src/__tests__/online/user-consent.spec.js @@ -1,6 +1,6 @@ import sinon from 'sinon'; import { SplitFactory } from '../../index'; -import { nearlyEqual, url, triggerUnloadEvent } from '../testUtils'; +import { nearlyEqual, url, triggerPagehideEvent } from '../testUtils'; const trackedImpressions = []; @@ -96,9 +96,9 @@ export default function userConsent(fetchMock, t) { ], ['on', 'on', 'on', 'on', 'on', 'on', 'on', 'on'], 'evaluating on SDK ready'); if (isTracking) expectedTrackedImpressions += 8; - // Trigger unload event to validate browser listener behaviour + // Trigger pagehide event to validate browser listener behaviour // Beacon API is used only if user consent is GRANTED - triggerUnloadEvent(); + triggerPagehideEvent(); if (factory.UserConsent.getStatus() === factory.UserConsent.Status.GRANTED) { assert.ok(sendBeaconSpy.calledThrice, 'sendBeacon should have been called thrice'); } else { diff --git a/src/__tests__/testUtils/index.js b/src/__tests__/testUtils/index.js index 36e0dba..a140557 100644 --- a/src/__tests__/testUtils/index.js +++ b/src/__tests__/testUtils/index.js @@ -72,10 +72,22 @@ export function url(settings, target) { return `${settings.urls.sdk}${target}`; } -// Util method to trigger 'unload' DOM event -export function triggerUnloadEvent() { +function triggerEvent(eventName) { const event = document.createEvent('HTMLEvents'); - event.initEvent('unload', true, true); - event.eventName = 'unload'; + event.initEvent(eventName, true, true); + event.eventName = eventName; window.dispatchEvent(event); } + +export function triggerUnloadEvent() { + triggerEvent('unload'); +} + +export function triggerPagehideEvent() { + triggerEvent('pagehide'); +} + +export function triggerVisibilitychange(state = 'hidden' /* 'hidden' | 'visible' */) { + Object.defineProperty(document, 'visibilityState', { value: state, writable: true }); + document.dispatchEvent(new Event('visibilitychange')); +} From a341ca23985a4785c85aaf13af08e6dc300079c5 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Mon, 18 Jul 2022 18:27:35 -0300 Subject: [PATCH 03/13] Added changelog entry --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 48d7581..939a734 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +0.7.1 (July XX, 2022) +- Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in mobile and modern Web browsers (See https://developer.chrome.com/blog/page-lifecycle-api/#legacy-lifecycle-apis-to-avoid). +- Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced. + 0.7.0 (June 29, 2022) - Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config sync.enabled . Running online Split will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used. - Updated telemetry logic to track the anonymous config for user consent flag set to declined or unknown. From 0f60ee925cb0b62cbcf49c0f7612f09c1cd17fb2 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 19 Jul 2022 17:16:39 -0300 Subject: [PATCH 04/13] reduce tests flakiness due to telemetry sample rate --- src/__tests__/destroy/browser.spec.js | 2 +- src/__tests__/gaIntegration/browser.spec.js | 3 ++- src/__tests__/online/browser.spec.js | 1 + src/__tests__/push/browser.spec.js | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/__tests__/destroy/browser.spec.js b/src/__tests__/destroy/browser.spec.js index 16a5038..79be403 100644 --- a/src/__tests__/destroy/browser.spec.js +++ b/src/__tests__/destroy/browser.spec.js @@ -19,10 +19,10 @@ const settings = settingsValidator({ fetchMock.getOnce(url(settings, '/splitChanges?since=-1'), { status: 200, body: splitChangesMock1 }); fetchMock.getOnce(url(settings, '/splitChanges?since=-1500492097547'), { status: 200, body: splitChangesMock2 }); - fetchMock.getOnce(url(settings, '/mySegments/ut1'), { status: 200, body: mySegmentsMock }); fetchMock.getOnce(url(settings, '/mySegments/ut2'), { status: 200, body: mySegmentsMock }); fetchMock.getOnce(url(settings, '/mySegments/ut3'), { status: 200, body: mySegmentsMock }); +fetchMock.postOnce(url(settings, '/v1/metrics/config'), 200); // 0.1% sample rate tape('SDK destroy for BrowserJS', async function (assert) { const config = { diff --git a/src/__tests__/gaIntegration/browser.spec.js b/src/__tests__/gaIntegration/browser.spec.js index dd34ef5..c1fbe67 100644 --- a/src/__tests__/gaIntegration/browser.spec.js +++ b/src/__tests__/gaIntegration/browser.spec.js @@ -14,10 +14,11 @@ const settings = settingsValidator({ } }); -tape('## E2E CI Tests ##', function(assert) { +tape('## E2E CI Tests ##', function (assert) { fetchMock.get(url(settings, '/splitChanges?since=-1'), { status: 200, body: splitChangesMock1 }); fetchMock.get(url(settings, '/mySegments/facundo%40split.io'), { status: 200, body: mySegmentsFacundo }); + fetchMock.post(/\/v1\/metrics/, 200); // 0.1% sample rate /* Validate GA integration */ assert.test('E2E / GA-to-Split', gaToSplitSuite.bind(null, fetchMock)); diff --git a/src/__tests__/online/browser.spec.js b/src/__tests__/online/browser.spec.js index 95f48bd..00a165c 100644 --- a/src/__tests__/online/browser.spec.js +++ b/src/__tests__/online/browser.spec.js @@ -91,6 +91,7 @@ tape('## E2E CI Tests ##', function (assert) { fetchMock.get(url(settings, '/mySegments/emmanuel%40split.io'), { status: 200, body: mySegmentsEmmanuel }); fetchMock.post(url(settings, '/testImpressions/bulk'), 200); fetchMock.post(url(settings, '/testImpressions/count'), 200); + Math.random = () => 0.5; // SDKs without telemetry /* Check client evaluations. */ assert.test('E2E / In Memory', evaluationsSuite.bind(null, configInMemory, fetchMock)); diff --git a/src/__tests__/push/browser.spec.js b/src/__tests__/push/browser.spec.js index cb97809..bcc033a 100644 --- a/src/__tests__/push/browser.spec.js +++ b/src/__tests__/push/browser.spec.js @@ -9,6 +9,7 @@ import { testRefreshToken } from './push-refresh-token.spec'; import { testSplitKillOnReadyFromCache } from './push-corner-cases.spec'; fetchMock.config.overwriteRoutes = false; +Math.random = () => 0.5; // SDKs without telemetry tape('## Browser JS - E2E CI Tests for PUSH ##', function (assert) { From af8ad62d05f57a0c85d688faefb3705b50e266cf Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 19 Jul 2022 17:32:30 -0300 Subject: [PATCH 05/13] update karma related dependencies --- package-lock.json | 454 ++++++++++++++++++++++++---------------------- package.json | 6 +- 2 files changed, 238 insertions(+), 222 deletions(-) diff --git a/package-lock.json b/package-lock.json index 956b0c8..5fe7853 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1645,6 +1645,12 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true + }, "@eslint/eslintrc": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", @@ -2177,12 +2183,6 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, - "@socket.io/base64-arraybuffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==", - "dev": true - }, "@splitsoftware/splitio-commons": { "version": "1.5.1-rc.1", "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.5.1-rc.1.tgz", @@ -2521,18 +2521,18 @@ }, "dependencies": { "mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true }, "mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "requires": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" } } } @@ -3065,27 +3065,29 @@ "dev": true }, "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, "body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", "dev": true, "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" }, "dependencies": { "debug": { @@ -3100,26 +3102,8 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true - }, - "raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", - "dev": true, - "requires": { - "bytes": "3.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } } } }, @@ -3331,19 +3315,38 @@ "dev": true }, "chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "~3.6.0" + }, + "dependencies": { + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + } } }, "ci-info": { @@ -3407,12 +3410,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "dev": true - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3479,7 +3476,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true } } @@ -3593,7 +3590,7 @@ "custom-event": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", + "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", "dev": true }, "data-urls": { @@ -3608,15 +3605,15 @@ } }, "date-format": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.3.tgz", - "integrity": "sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ==", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.11.tgz", + "integrity": "sha512-VS20KRyorrbMCQmpdl2hg5KaOUsda1RbnsJg461FfrcyCUg+pkd0b40BSW4niQyTheww4DBXQnS7HwSrKkipLw==", "dev": true }, "debounce": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz", - "integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", "dev": true }, "debug": { @@ -3700,9 +3697,15 @@ "dev": true }, "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true }, "detect-newline": { @@ -3714,7 +3717,7 @@ "di": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", + "integrity": "sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==", "dev": true }, "diff": { @@ -3750,7 +3753,7 @@ "dom-serialize": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", + "integrity": "sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ==", "dev": true, "requires": { "custom-event": "~1.0.0", @@ -3794,7 +3797,7 @@ "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "dev": true }, "electron-to-chromium": { @@ -3818,13 +3821,13 @@ "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "dev": true }, "engine.io": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.2.tgz", - "integrity": "sha512-v/7eGHxPvO2AWsksyx2PUsQvBafuvqs0jJJQ0FdmJG1b9qIvgSbqDRGwNhfk2XHaTTbTXiC4quRE8Q9nRjsrQQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.0.tgz", + "integrity": "sha512-4KzwW3F3bk+KlzSOY57fj/Jx6LyRQ1nbcyIadehl+AnXjKT7gDO0ORdRi/84ixvMKTym6ZKuxvbzN62HDDU1Lg==", "dev": true, "requires": { "@types/cookie": "^0.4.1", @@ -3835,7 +3838,7 @@ "cookie": "~0.4.1", "cors": "~2.8.5", "debug": "~4.3.1", - "engine.io-parser": "~5.0.0", + "engine.io-parser": "~5.0.3", "ws": "~8.2.3" }, "dependencies": { @@ -3848,13 +3851,10 @@ } }, "engine.io-parser": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz", - "integrity": "sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==", - "dev": true, - "requires": { - "@socket.io/base64-arraybuffer": "~1.0.2" - } + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.4.tgz", + "integrity": "sha512-+nVFp+5z1E3HcToEnO7ZIj3g+3k9389DvWtvJZz0T6/eOCPIyyxehFcedoYrZQrp0LgQbD9pPXhpMBKMd5QURg==", + "dev": true }, "enquirer": { "version": "2.3.6", @@ -3868,7 +3868,7 @@ "ent": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", + "integrity": "sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==", "dev": true }, "es-abstract": { @@ -3927,7 +3927,7 @@ "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "dev": true }, "escape-string-regexp": { @@ -4593,7 +4593,22 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "dev": true } } @@ -4625,9 +4640,9 @@ "dev": true }, "follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", "dev": true }, "for-each": { @@ -4651,9 +4666,9 @@ } }, "fs-extra": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, "requires": { "graceful-fs": "^4.2.0", @@ -4893,15 +4908,15 @@ "dev": true }, "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "requires": { - "depd": "~1.1.2", + "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", + "statuses": "2.0.1", "toidentifier": "1.0.1" } }, @@ -5282,9 +5297,9 @@ } }, "isbinaryfile": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.8.tgz", - "integrity": "sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", + "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", "dev": true }, "isbot": { @@ -6120,15 +6135,15 @@ "dev": true }, "karma": { - "version": "6.3.16", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.3.16.tgz", - "integrity": "sha512-nEU50jLvDe5yvXqkEJRf8IuvddUkOY2x5Xc4WXHz6dxINgGDrgD2uqQWeVrJs4hbfNaotn+HQ1LZJ4yOXrL7xQ==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.0.tgz", + "integrity": "sha512-s8m7z0IF5g/bS5ONT7wsOavhW4i4aFkzD4u4wgzAQWT4HGUeWI3i21cK2Yz6jndMAeHETp5XuNsRoyGJZXVd4w==", "dev": true, "requires": { + "@colors/colors": "1.5.0", "body-parser": "^1.19.0", "braces": "^3.0.2", "chokidar": "^3.5.1", - "colors": "1.4.0", "connect": "^3.7.0", "di": "^0.0.1", "dom-serialize": "^2.2.1", @@ -6144,79 +6159,42 @@ "qjobs": "^1.2.0", "range-parser": "^1.2.1", "rimraf": "^3.0.2", - "socket.io": "^4.2.0", + "socket.io": "^4.4.1", "source-map": "^0.6.1", "tmp": "^0.2.1", "ua-parser-js": "^0.7.30", "yargs": "^16.1.1" }, "dependencies": { - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, "graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", - "dev": true - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, "ua-parser-js": { @@ -6228,9 +6206,9 @@ } }, "karma-chrome-launcher": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz", - "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.1.tgz", + "integrity": "sha512-hsIglcq1vtboGPAN+DGCISCFOxW+ZVnIqhDQcCMqqCp+4dmJ0Qpq5QAjkbA0X2L9Mi6OBkHi2Srrbmm7pUKkzQ==", "dev": true, "requires": { "which": "^1.2.1" @@ -6248,9 +6226,9 @@ } }, "karma-rollup-preprocessor": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/karma-rollup-preprocessor/-/karma-rollup-preprocessor-7.0.5.tgz", - "integrity": "sha512-VhZI81l8LZBvBrSf4xaojsbur7bcycsSlxXkYaTOjV6DQwx1gtAM0CQVdue7LuIbXB1AohYIg0S5at+dqDtMxQ==", + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/karma-rollup-preprocessor/-/karma-rollup-preprocessor-7.0.8.tgz", + "integrity": "sha512-WiuBCS9qsatJuR17dghiTARBZ7LF+ml+eb7qJXhw7IbsdY0lTWELDRQC/93J9i6636CsAXVBL3VJF4WtaFLZzA==", "dev": true, "requires": { "chokidar": "^3.3.1", @@ -6334,31 +6312,31 @@ "dev": true }, "log4js": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.1.tgz", - "integrity": "sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.6.0.tgz", + "integrity": "sha512-3v8R7fd45UB6THucSht6wN2/7AZEruQbXdjygPZcxt5TA/msO6si9CN5MefUuKXbYnJHTBnYcx4famwcyQd+sA==", "dev": true, "requires": { - "date-format": "^4.0.3", - "debug": "^4.3.3", - "flatted": "^3.2.4", + "date-format": "^4.0.11", + "debug": "^4.3.4", + "flatted": "^3.2.5", "rfdc": "^1.3.0", - "streamroller": "^3.0.2" + "streamroller": "^3.1.1" }, "dependencies": { "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" } }, "flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", + "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true } } @@ -6408,7 +6386,7 @@ "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "dev": true }, "merge-stream": { @@ -6485,12 +6463,12 @@ "dev": true }, "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, "requires": { - "minimist": "^1.2.5" + "minimist": "^1.2.6" } }, "ms": { @@ -6589,7 +6567,7 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true }, "object-inspect": { @@ -6745,9 +6723,9 @@ } }, "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "requires": { "ee-first": "1.1.1" @@ -6978,6 +6956,15 @@ "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", "dev": true }, + "qs": { + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + }, "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", @@ -6999,6 +6986,18 @@ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true }, + "raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, "react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -7006,9 +7005,9 @@ "dev": true }, "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { "picomatch": "^2.2.1" @@ -7225,7 +7224,7 @@ "requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, "resolve": { @@ -7674,23 +7673,23 @@ } }, "socket.io": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.4.1.tgz", - "integrity": "sha512-s04vrBswdQBUmuWJuuNTmXUVJhP0cVky8bBDhdkf8y0Ptsu7fKU2LuLbts9g+pdmAdyMMn8F/9Mf1/wbtUN0fg==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.1.tgz", + "integrity": "sha512-0y9pnIso5a9i+lJmsCdtmTTgJFFSvNQKDnPQRz28mGNnxbmqYg2QPtJTLFxhymFZhAIn50eHAKzJeiNaKr+yUQ==", "dev": true, "requires": { "accepts": "~1.3.4", "base64id": "~2.0.0", "debug": "~4.3.2", - "engine.io": "~6.1.0", - "socket.io-adapter": "~2.3.3", + "engine.io": "~6.2.0", + "socket.io-adapter": "~2.4.0", "socket.io-parser": "~4.0.4" }, "dependencies": { "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -7699,15 +7698,15 @@ } }, "socket.io-adapter": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz", - "integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz", + "integrity": "sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==", "dev": true }, "socket.io-parser": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", - "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.5.tgz", + "integrity": "sha512-sNjbT9dX63nqUFIOv95tTVm6elyIU4RvB1m8dOeZt+IgWwcWklFDOdmGcfo3zSiRsnR/3pJkjY5lfoGqEe4Eig==", "dev": true, "requires": { "@types/component-emitter": "^1.2.10", @@ -7715,6 +7714,12 @@ "debug": "~4.3.1" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", @@ -7763,20 +7768,31 @@ } }, "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true }, "streamroller": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.2.tgz", - "integrity": "sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.1.tgz", + "integrity": "sha512-iPhtd9unZ6zKdWgMeYGfSBuqCngyJy1B/GPi/lTpwGpa3bajuX30GjUVd0/Tn/Xhg0mr4DOSENozz9Y06qyonQ==", "dev": true, "requires": { - "date-format": "^4.0.3", - "debug": "^4.1.1", - "fs-extra": "^10.0.0" + "date-format": "^4.0.10", + "debug": "^4.3.4", + "fs-extra": "^10.1.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } } }, "string-length": { @@ -8362,7 +8378,7 @@ "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true }, "uri-js": { @@ -8377,7 +8393,7 @@ "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "dev": true }, "v8-compile-cache": { @@ -8408,13 +8424,13 @@ "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "dev": true }, "void-elements": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", + "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==", "dev": true }, "w3c-hr-time": { diff --git a/package.json b/package.json index 320c1a8..9c73c7f 100644 --- a/package.json +++ b/package.json @@ -77,9 +77,9 @@ "eslint-plugin-import": "^2.25.4", "fetch-mock": "^9.11.0", "jest": "^27.2.3", - "karma": "^6.3.16", - "karma-chrome-launcher": "^3.1.0", - "karma-rollup-preprocessor": "^7.0.5", + "karma": "^6.4.0", + "karma-chrome-launcher": "^3.1.1", + "karma-rollup-preprocessor": "^7.0.8", "karma-tap": "^4.2.0", "replace": "^1.2.1", "rimraf": "^3.0.2", From df836355a040a199c22cf3bd00ee7c59355aadff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Jul 2022 04:10:46 +0000 Subject: [PATCH 06/13] Bump terser from 5.5.1 to 5.14.2 Bumps [terser](https://github.com/terser/terser) from 5.5.1 to 5.14.2. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/commits) --- updated-dependencies: - dependency-name: terser dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d71935..73fe3af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2015,6 +2015,16 @@ "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==", "dev": true }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@jridgewell/sourcemap-codec": { "version": "1.4.11", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", @@ -7715,6 +7725,12 @@ "debug": "~4.3.1" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", @@ -8040,21 +8056,32 @@ } }, "terser": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.5.1.tgz", - "integrity": "sha512-6VGWZNVP2KTUcltUQJ25TtNjx/XgdDsBDKGt8nN0MpydU36LmbPPcMBd2kmtZNNGVVDLg44k7GKeHHj+4zPIBQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "requires": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" + "source-map-support": "~0.5.20" }, "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "acorn": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } } } }, From e057166ac55272ec7c7cc052c58845f96e208261 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Thu, 21 Jul 2022 20:43:30 -0300 Subject: [PATCH 07/13] update js-commons --- CHANGES.txt | 5 +++-- package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 939a734..095ee4b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,7 @@ -0.7.1 (July XX, 2022) -- Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in mobile and modern Web browsers (See https://developer.chrome.com/blog/page-lifecycle-api/#legacy-lifecycle-apis-to-avoid). +0.7.1 (July 22, 2022) +- Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in modern mobile and desktop Web browsers. - Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced. +- Updated some dependencies for vulnerability fixes. 0.7.0 (June 29, 2022) - Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config sync.enabled . Running online Split will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used. diff --git a/package-lock.json b/package-lock.json index 146e140..b99aea4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2194,9 +2194,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "1.5.1-rc.1", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.5.1-rc.1.tgz", - "integrity": "sha512-NeVreo+igjYrlcWPq0gMEyE6QTxSv906S96X1XmibP/vcJFS90E9Vbr4GAAZKxrV0qh2FC5nMoGtYD7T4nhlhQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.6.0.tgz", + "integrity": "sha512-Y6BIOsk9mLnZC1EMweWaikLRtjoAnwnmuW89vfBO3P5wpe2AkC0CCR+Sk6mf67Fa60+vclCrF7o8XpePIbltsw==", "requires": { "tslib": "^2.3.1" } diff --git a/package.json b/package.json index 9c73c7f..f7cf6a1 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "bugs": "https://github.com/splitio/javascript-browser-client/issues", "homepage": "https://github.com/splitio/javascript-browser-client#readme", "dependencies": { - "@splitsoftware/splitio-commons": "1.5.1-rc.1", + "@splitsoftware/splitio-commons": "1.6.0", "@types/google.analytics": "0.0.40" }, "devDependencies": { From e81c95ee8ccf36a2526fb2954a37d196fd56465c Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Thu, 21 Jul 2022 22:24:19 -0300 Subject: [PATCH 08/13] added autoRequire flag to GaToSplit integration --- CHANGES.txt | 3 +- .../gaIntegration/ga-to-split.spec.js | 46 +++++++++++++++++++ src/__tests__/gaIntegration/gaTestUtils.js | 12 +++-- ts-tests/index.ts | 1 + types/full/index.d.ts | 4 +- types/index.d.ts | 4 +- types/splitio.d.ts | 23 +++++++--- 7 files changed, 77 insertions(+), 16 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 095ee4b..e52991f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ -0.7.1 (July 22, 2022) +0.8.0 (July 22, 2022) +- Added `autoRequire` configuration option to the Google Analytics to Split integration, which takes care of requiring the splitTracker plugin on trackers dynamically created by Google tag managers (See https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js). - Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in modern mobile and desktop Web browsers. - Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced. - Updated some dependencies for vulnerability fixes. diff --git a/src/__tests__/gaIntegration/ga-to-split.spec.js b/src/__tests__/gaIntegration/ga-to-split.spec.js index 7cacb41..815f4b1 100644 --- a/src/__tests__/gaIntegration/ga-to-split.spec.js +++ b/src/__tests__/gaIntegration/ga-to-split.spec.js @@ -406,4 +406,50 @@ export default function (fetchMock, assert) { }); + // test 'autoRequire' script placed right after GA script tag. + // We get same result if it is placed right before, and also applies for Universal Analytics configured with GTM and gtag.js tags. + // If it is executed asynchronously, trackers creation might be missed. + assert.test(t => { + fetchMock.postOnce(url(settings, '/events/bulk'), (url, opts) => { + const resp = JSON.parse(opts.body); + const sentHitsTracker1 = window.gaSpy.getHits('tracker1'); + const sentHitsTracker2 = window.gaSpy.getHits('tracker2'); + + t.equal(resp.length, sentHitsTracker1.length + sentHitsTracker2.length, 'All hits of all trackers are captured as Split events'); + + setTimeout(() => { + client.destroy(); + t.end(); + }); + return 200; + }); + + gaTag(); + + // Run autoRequire iife. `require` cannot be used because it is not polyfilled by "rollup-plugin-node-polyfills" + // eslint-disable-next-line + (function(n,t,e){n[e]=n[e]||t;n[t]=n[t]||function(){n[t].q.push(arguments)};n[t].q=n[t].q||[];var r={};function i(n){return typeof n==="object"&&typeof n.name==="string"&&n.name}function o(e){if(e&&e[0]==="create"){var o=i(e[1])||i(e[2])||i(e[3])||(typeof e[3]==="string"?e[3]:undefined);if(!r[o]){r[o]=true;n[t]((o?o+".":"")+"require","splitTracker")}}}n[t].q.forEach(o);var u=n[t].q.push;n[t].q.push=function(n){var t=u.apply(this,arguments);o(n);return t}})(window,"ga","GoogleAnalyticsObject"); + + window.ga('create', 'UA-00000000-1', { name: 'tracker1', cookieDomain: 'auto', siteSpeedSampleRate: 0 }); + + gaSpy(['tracker1']); + + window.ga('tracker1.send', 'event', 'mycategory', 'myaction1'); // Captured + + const factory = SplitFactory({ + ...config, + integrations: [GoogleAnalyticsToSplit({ + autoRequire: true + })], + }); + + window.ga('tracker1.send', 'event', 'mycategory', 'myaction2'); // Captured + window.ga('create', 'UA-00000001-1', 'auto', 'tracker2', { siteSpeedSampleRate: 0 }); // New tracker + gaSpy(['tracker2'], false); + window.ga('tracker2.send', 'event', 'mycategory', 'myaction3'); // Captured + + client = factory.client(); + + }); + } diff --git a/src/__tests__/gaIntegration/gaTestUtils.js b/src/__tests__/gaIntegration/gaTestUtils.js index ca6e171..e0aac43 100644 --- a/src/__tests__/gaIntegration/gaTestUtils.js +++ b/src/__tests__/gaIntegration/gaTestUtils.js @@ -2,19 +2,21 @@ export const DEFAULT_TRACKER = 't0'; const HIT_FIELDS = ['hitType', 'nonInteraction']; const EVENT_FIELDS = ['eventCategory', 'eventAction', 'eventLabel', 'eventValue']; +const FIELDS = [...HIT_FIELDS, ...EVENT_FIELDS]; // List of hit fields to spy, which are the ones set by the default SplitToGa mapper. + +let hits = {}; /** * Spy ga hits per tracker. * * @param {string[]} trackerNames names of the trackers to spy. If not provided, it spies the default tracker. i.e., `gaSpy()` is equivalent to `gaSpy(['t0'])`. - * @param {string[]} fieldNames names of the hit fields to spy. If not provided, it spies hit and event related fields. i.e., 'hitType', 'nonInteraction', - * 'eventCategory', 'eventAction', 'eventLabel', and 'eventValue', which are the ones set by default SplitToGa mapper. + * @param {boolean} resetSpy true to reset the list of captured hits. * * @see {@link https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference} */ -export function gaSpy(trackerNames = [DEFAULT_TRACKER], fieldNames = [...HIT_FIELDS, ...EVENT_FIELDS]) { +export function gaSpy(trackerNames = [DEFAULT_TRACKER], resetSpy = true) { - const hits = {}; + if (resetSpy) hits = {}; // access ga via its gaAlias, accounting for the possibility that the global command queue // has been renamed or not yet defined (analytics.js mutates window[gaAlias] reference) @@ -31,7 +33,7 @@ export function gaSpy(trackerNames = [DEFAULT_TRACKER], fieldNames = [...HIT_FIE trackerToSniff.set('sendHitTask', function (model) { originalSendHitTask(model); const hit = {}; - fieldNames.forEach(fieldName => { + FIELDS.forEach(fieldName => { hit[fieldName] = model.get(fieldName); }); hits[trackerName].push(hit); diff --git a/ts-tests/index.ts b/ts-tests/index.ts index adb1c1c..facca4d 100644 --- a/ts-tests/index.ts +++ b/ts-tests/index.ts @@ -476,6 +476,7 @@ let customGoogleAnalyticsToSplitConfig: SplitIO.GoogleAnalyticsToSplitOptions = mapper: function (model: UniversalAnalytics.Model, defaultMapping: SplitIO.EventData): SplitIO.EventData { return eventDataSample; }, prefix: 'PREFIX', identities: [{ key: 'key1', trafficType: 'tt1' }, { key: 'key2', trafficType: 'tt2' }], + autoRequire: true }; let customSplitToGoogleAnalyticsConfig: SplitIO.SplitToGoogleAnalyticsOptions = { events: false, diff --git a/types/full/index.d.ts b/types/full/index.d.ts index 151fcfa..50536af 100644 --- a/types/full/index.d.ts +++ b/types/full/index.d.ts @@ -35,14 +35,14 @@ declare module JsSdk { /** * Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events. * - * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#integrations} + * @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split} */ export function GoogleAnalyticsToSplit(options?: SplitIO.GoogleAnalyticsToSplitOptions): SplitIO.IntegrationFactory; /** * Enable 'Split to Google Analytics' integration, to track Split impressions and events as Google Analytics hits. * - * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#integrations} + * @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics} */ export function SplitToGoogleAnalytics(options?: SplitIO.SplitToGoogleAnalyticsOptions): SplitIO.IntegrationFactory; diff --git a/types/index.d.ts b/types/index.d.ts index 35e41e5..25d89a9 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -35,14 +35,14 @@ declare module JsSdk { /** * Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events. * - * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#integrations} + * @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split} */ export function GoogleAnalyticsToSplit(options?: SplitIO.GoogleAnalyticsToSplitOptions): SplitIO.IntegrationFactory; /** * Enable 'Split to Google Analytics' integration, to track Split impressions and events as Google Analytics hits. * - * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#integrations} + * @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics} */ export function SplitToGoogleAnalytics(options?: SplitIO.SplitToGoogleAnalyticsOptions): SplitIO.IntegrationFactory; diff --git a/types/splitio.d.ts b/types/splitio.d.ts index bde87bf..be289de 100644 --- a/types/splitio.d.ts +++ b/types/splitio.d.ts @@ -244,11 +244,11 @@ interface ISharedSettings { */ localhostMode?: SplitIO.LocalhostFactory /** - * Controls the SDK continuous synchronization flags. - * - * When `true` a running SDK will process rollout plan updates performed on the UI (default). + * Controls the SDK continuous synchronization flags. + * + * When `true` a running SDK will process rollout plan updates performed on the UI (default). * When false it'll just fetch all data upon init - * + * * @property {boolean} enabled * @default true */ @@ -628,7 +628,7 @@ declare namespace SplitIO { /** * Configuration params for 'Google Analytics to Split' integration plugin, to track Google Analytics hits as Split events. * - * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#integrations} + * @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split} */ interface GoogleAnalyticsToSplitOptions { /** @@ -669,6 +669,17 @@ declare namespace SplitIO { * If not provided, events are sent using the key and traffic type provided at SDK config. */ identities: Identity[], + /** + * Optional flag to log an error if the `auto-require` script is not detected. + * The auto-require script automatically requires the `splitTracker` plugin for created trackers, + * and should be placed right after your Google Analytics, Google Tag Manager or gtag.js script tag. + * + * @see {@link https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js} + * + * @property {boolean} autoRequire + * @default false + */ + autoRequire?: boolean, } /** * Object representing the data sent by Split (events and impressions). @@ -680,7 +691,7 @@ declare namespace SplitIO { /** * Configuration params for 'Split to Google Analytics' integration plugin, to track Split impressions and events as Google Analytics hits. * - * @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#integrations} + * @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics} */ interface SplitToGoogleAnalyticsOptions { /** From 23b45dd1fd74453f35aabaccd7cdd5c062296ecd Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 22 Jul 2022 11:31:48 -0300 Subject: [PATCH 09/13] added /scripts/ga-to-split-autorequire --- package.json | 4 +++- scripts/ga-to-split-autorequire.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 scripts/ga-to-split-autorequire.js diff --git a/package.json b/package.json index f7cf6a1..0637b3c 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "esm", "src", "types", - "full" + "full", + "scripts/ga-to-split-autorequire.js" ], "scripts": { "check": "npm run check:lint && npm run check:types && npm run check:version", @@ -26,6 +27,7 @@ "build:cjs": "rimraf cjs && tsc -outDir cjs -m CommonJS && ./scripts/build_cjs_replace_imports.sh", "build:umd-visualizer": "rollup --config rollup.visualizer.config.js", "build:umd": "rollup --config rollup.ci.config.js --branch=$BUILD_BRANCH --commit_hash=$BUILD_COMMIT", + "build:ga-to-split-autorequire": "terser ./node_modules/@splitsoftware/splitio-commons/src/integrations/ga/autoRequire.js --mangle --output ./scripts/ga-to-split-autorequire.js", "test": "npm run test:unit && npm run test:e2e", "test:unit": "jest", "test:e2e": "npm run test:e2e-logger && npm run test:e2e-offline && npm run test:e2e-online && npm run test:e2e-destroy && npm run test:e2e-errors && npm run test:e2e-push && npm run test:e2e-gaintegration && npm run test:e2e-consumer", diff --git a/scripts/ga-to-split-autorequire.js b/scripts/ga-to-split-autorequire.js new file mode 100644 index 0000000..7f8b885 --- /dev/null +++ b/scripts/ga-to-split-autorequire.js @@ -0,0 +1 @@ +(function(n,t,e){n[e]=n[e]||t;n[t]=n[t]||function(){n[t].q.push(arguments)};n[t].q=n[t].q||[];var r={};function i(n){return typeof n==="object"&&typeof n.name==="string"&&n.name}function o(e){if(e&&e[0]==="create"){var o=i(e[1])||i(e[2])||i(e[3])||(typeof e[3]==="string"?e[3]:undefined);if(!r[o]){r[o]=true;n[t]((o?o+".":"")+"require","splitTracker")}}}n[t].q.forEach(o);var u=n[t].q.push;n[t].q.push=function(n){var t=u.apply(this,arguments);o(n);return t}})(window,"ga","GoogleAnalyticsObject"); \ No newline at end of file From 8632cb5ea6e9e657495fcc4cc6774c54c55738ff Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 22 Jul 2022 11:35:01 -0300 Subject: [PATCH 10/13] update ci-cd for rc --- .github/workflows/ci-cd.yml | 4 ++-- package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 86739af..e163ef7 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -42,14 +42,14 @@ jobs: run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") BUILD_COMMIT=${{ github.sha }} npm run build - name: Configure AWS credentials (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/ga_auto_require' }} uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: arn:aws:iam::079419646996:role/public-assets aws-region: us-east-1 - name: Upload to S3 (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/ga_auto_require' }} run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS env: BUCKET: split-public-stage diff --git a/package-lock.json b/package-lock.json index b99aea4..f4ff82a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2194,9 +2194,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.6.0.tgz", - "integrity": "sha512-Y6BIOsk9mLnZC1EMweWaikLRtjoAnwnmuW89vfBO3P5wpe2AkC0CCR+Sk6mf67Fa60+vclCrF7o8XpePIbltsw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.6.1.tgz", + "integrity": "sha512-lijSMpX5a7HiphPnzr7fKlicGSd5TeBWX5URLPWfL87SPlO+8iF7S7PNFPg8GMu+44CdRrp4REHPJo97ht6ePQ==", "requires": { "tslib": "^2.3.1" } diff --git a/package.json b/package.json index 0637b3c..fc71926 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "bugs": "https://github.com/splitio/javascript-browser-client/issues", "homepage": "https://github.com/splitio/javascript-browser-client#readme", "dependencies": { - "@splitsoftware/splitio-commons": "1.6.0", + "@splitsoftware/splitio-commons": "1.6.1", "@types/google.analytics": "0.0.40" }, "devDependencies": { From 6f0e14a169ab473f94fa1708d9492adf8e2bc951 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 22 Jul 2022 11:54:02 -0300 Subject: [PATCH 11/13] stable release version --- package-lock.json | 2 +- package.json | 2 +- src/settings/defaults.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f4ff82a..91f54f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-browserjs", - "version": "0.7.1-rc.0", + "version": "0.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fc71926..dcb575e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-browserjs", - "version": "0.7.1-rc.0", + "version": "0.8.0", "description": "Split SDK for Javascript on Browser", "main": "cjs/index.js", "module": "esm/index.js", diff --git a/src/settings/defaults.ts b/src/settings/defaults.ts index 4225aeb..5a9b687 100644 --- a/src/settings/defaults.ts +++ b/src/settings/defaults.ts @@ -2,7 +2,7 @@ import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/ import { ConsentStatus, LogLevel } from '@splitsoftware/splitio-commons/src/types'; import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants'; -const packageVersion = '0.7.1-rc.0'; +const packageVersion = '0.8.0'; /** * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item. From 4ace32b5c4ce9be2aa88670e5193a656aba7c461 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 22 Jul 2022 12:56:33 -0300 Subject: [PATCH 12/13] restore ci-cd --- .github/workflows/ci-cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index e163ef7..86739af 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -42,14 +42,14 @@ jobs: run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") BUILD_COMMIT=${{ github.sha }} npm run build - name: Configure AWS credentials (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/ga_auto_require' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} uses: aws-actions/configure-aws-credentials@v1 with: role-to-assume: arn:aws:iam::079419646996:role/public-assets aws-region: us-east-1 - name: Upload to S3 (development) - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/ga_auto_require' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }} run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS env: BUCKET: split-public-stage From 87f93e02778fe0ce9f1de97e548672837f7f8306 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 22 Jul 2022 15:18:32 -0300 Subject: [PATCH 13/13] added asserts to push e2e tests --- src/__tests__/push/push-synchronization.spec.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/__tests__/push/push-synchronization.spec.js b/src/__tests__/push/push-synchronization.spec.js index 1865167..4f5d01a 100644 --- a/src/__tests__/push/push-synchronization.spec.js +++ b/src/__tests__/push/push-synchronization.spec.js @@ -93,7 +93,7 @@ const MILLIS_UNLOAD_BROWSER_EVENT = 1700; * 1.7 secs: 'unload' browser event -> streaming connection closed */ export function testSynchronization(fetchMock, assert) { - assert.plan(36); + assert.plan(38); fetchMock.reset(); let start, splitio, client, otherClient, keylistAddClient, keylistRemoveClient, bitmapTrueClient, sharedClients = []; @@ -134,11 +134,14 @@ export function testSynchronization(fetchMock, assert) { setTimeout(() => { assert.equal(client.getTreatment('whitelist'), 'allowed', 'evaluation with not killed Split'); - client.once(client.Event.SDK_UPDATE, () => { + const onUpdateCb = () => { const lapse = Date.now() - start; assert.true(nearlyEqual(lapse, MILLIS_SPLIT_KILL_EVENT), 'SDK_UPDATE due to SPLIT_KILL event'); assert.equal(client.getTreatment('whitelist'), 'not_allowed', 'evaluation with killed Split'); - }); + }; + // SPLIT_KILL triggers two SDK_UPDATE events. The 1st due to `killLocally` and the 2nd due to `/splitChanges` fetch + client.once(client.Event.SDK_UPDATE, onUpdateCb); + client.once(client.Event.SDK_UPDATE, onUpdateCb); eventSourceInstance.emitMessage(splitKillMessage); }, MILLIS_SPLIT_KILL_EVENT); // send a SPLIT_KILL event with a new changeNumber after 0.5 seconds