From 087e77202be4b7ae6d73fc602bc60b5a10ea050d Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 3 Sep 2024 17:51:10 -0300 Subject: [PATCH] Update tests with new auth payloads and notification types --- package-lock.json | 18 ++--- package.json | 4 +- .../browserSuites/push-fallback.spec.js | 24 +++---- .../push-initialization-retries.spec.js | 2 +- .../push-synchronization-retries.spec.js | 30 ++++---- .../push-synchronization.spec.js | 71 ++++++++++--------- src/__tests__/browserSuites/readiness.spec.js | 4 +- .../auth.pushEnabled.nicolas@split.io.json | 2 +- ...bled.nicolas@split.io.marcio@split.io.json | 2 +- ..._UPDATE.SEGMENT_REMOVAL.1457552653000.json | 4 ++ ..._UPDATE.UNBOUNDED.DELAY.1457552650000.json | 4 ++ ..._MS_UPDATE.BOUNDED.GZIP.1457552651000.json | 4 ++ ..._MS_UPDATE.BOUNDED.ZLIB.1457552651000.json | 4 ++ ..._MS_UPDATE.KEYLIST.GZIP.1457552652000.json | 4 ++ ..._UPDATE.SEGMENT_REMOVAL.1457552653000.json | 4 ++ ...IPS_MS_UPDATE.UNBOUNDED.1457552640000.json | 4 ++ ...IPS_MS_UPDATE.UNBOUNDED.1457552650000.json | 4 ++ ..._UPDATE.SEGMENT_REMOVAL.1457552653000.json | 4 -- ..._UPDATE.UNBOUNDED.DELAY.1457552650000.json | 4 -- ..._MS_UPDATE.BOUNDED.GZIP.1457552651000.json | 4 -- ..._MS_UPDATE.BOUNDED.ZLIB.1457552651000.json | 4 -- ..._MS_UPDATE.KEYLIST.GZIP.1457552652000.json | 4 -- ..._UPDATE.SEGMENT_REMOVAL.1457552653000.json | 4 -- ...HIP_MS_UPDATE.UNBOUNDED.1457552640000.json | 4 -- ...HIP_MS_UPDATE.UNBOUNDED.1457552650000.json | 4 -- src/settings/defaults/version.js | 2 +- 26 files changed, 112 insertions(+), 111 deletions(-) create mode 100644 src/__tests__/mocks/message.MEMBERSHIPS_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json create mode 100644 src/__tests__/mocks/message.MEMBERSHIPS_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json create mode 100644 src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.BOUNDED.GZIP.1457552651000.json create mode 100644 src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json create mode 100644 src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.KEYLIST.GZIP.1457552652000.json create mode 100644 src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json create mode 100644 src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552640000.json create mode 100644 src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552650000.json delete mode 100644 src/__tests__/mocks/message.MEMBERSHIP_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json delete mode 100644 src/__tests__/mocks/message.MEMBERSHIP_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json delete mode 100644 src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.BOUNDED.GZIP.1457552651000.json delete mode 100644 src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json delete mode 100644 src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.KEYLIST.GZIP.1457552652000.json delete mode 100644 src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json delete mode 100644 src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552640000.json delete mode 100644 src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552650000.json diff --git a/package-lock.json b/package-lock.json index 893173807..ab58f360d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@splitsoftware/splitio", - "version": "10.27.1-rc.3", + "version": "10.27.1-rc.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio", - "version": "10.27.1-rc.3", + "version": "10.27.1-rc.4", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio-commons": "1.16.1-rc.11", + "@splitsoftware/splitio-commons": "1.16.1-rc.12", "@types/google.analytics": "0.0.40", "@types/ioredis": "^4.28.0", "bloom-filters": "^3.0.0", @@ -872,9 +872,9 @@ "dev": true }, "node_modules/@splitsoftware/splitio-commons": { - "version": "1.16.1-rc.11", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.16.1-rc.11.tgz", - "integrity": "sha512-w1Hv6y98PaIUCAy4DP+0l0GabagPwt+4u9Z6BsTtXlnWjkSXfgHQJnR2EjdhU5xrACdgR+x9rENm2ZSjioNebg==", + "version": "1.16.1-rc.12", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.16.1-rc.12.tgz", + "integrity": "sha512-OOkjuR1y48SGoZ5Z3TMdPyngAv4xQJ8cK7ydUSlMwkCFU4nT3u5kfpwoafr3v+7i7K6zneDfW8z0VeIXYY8wAw==", "dependencies": { "tslib": "^2.3.1" }, @@ -8416,9 +8416,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "1.16.1-rc.11", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.16.1-rc.11.tgz", - "integrity": "sha512-w1Hv6y98PaIUCAy4DP+0l0GabagPwt+4u9Z6BsTtXlnWjkSXfgHQJnR2EjdhU5xrACdgR+x9rENm2ZSjioNebg==", + "version": "1.16.1-rc.12", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.16.1-rc.12.tgz", + "integrity": "sha512-OOkjuR1y48SGoZ5Z3TMdPyngAv4xQJ8cK7ydUSlMwkCFU4nT3u5kfpwoafr3v+7i7K6zneDfW8z0VeIXYY8wAw==", "requires": { "tslib": "^2.3.1" } diff --git a/package.json b/package.json index 6a5f4bc56..9d21f96e9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "10.27.1-rc.3", + "version": "10.27.1-rc.4", "description": "Split SDK", "files": [ "README.md", @@ -40,7 +40,7 @@ "node": ">=6" }, "dependencies": { - "@splitsoftware/splitio-commons": "1.16.1-rc.11", + "@splitsoftware/splitio-commons": "1.16.1-rc.12", "@types/google.analytics": "0.0.40", "@types/ioredis": "^4.28.0", "bloom-filters": "^3.0.0", diff --git a/src/__tests__/browserSuites/push-fallback.spec.js b/src/__tests__/browserSuites/push-fallback.spec.js index 87a1c3db6..dc8df88b9 100644 --- a/src/__tests__/browserSuites/push-fallback.spec.js +++ b/src/__tests__/browserSuites/push-fallback.spec.js @@ -20,7 +20,7 @@ import streamingPausedControlPriMessage2 from '../mocks/message.CONTROL.STREAMIN import streamingDisabledControlPriMessage from '../mocks/message.CONTROL.STREAMING_DISABLED.control_pri.1586987434950.json'; import splitUpdateMessage from '../mocks/message.SPLIT_UPDATE.1457552649999.json'; -import mySegmentsUpdateMessage from '../mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552640000.json'; +import mySegmentsUpdateMessage from '../mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552640000.json'; import authPushEnabledNicolas from '../mocks/auth.pushEnabled.nicolas@split.io.json'; import authPushEnabledNicolasAndMarcio from '../mocks/auth.pushEnabled.nicolas@split.io.marcio@split.io.json'; @@ -66,11 +66,11 @@ const MILLIS_CREATE_CLIENT_DURING_PUSH = MILLIS_STREAMING_UP_OCCUPANCY + 50; const MILLIS_SPLIT_UPDATE_EVENT_DURING_PUSH = MILLIS_STREAMING_UP_OCCUPANCY + 100; const MILLIS_STREAMING_PAUSED_CONTROL = MILLIS_SPLIT_UPDATE_EVENT_DURING_PUSH + 100; -const MILLIS_MEMBERSHIP_MS_UPDATE_EVENT_DURING_POLLING = MILLIS_STREAMING_PAUSED_CONTROL + 100; +const MILLIS_MEMBERSHIPS_MS_UPDATE_EVENT_DURING_POLLING = MILLIS_STREAMING_PAUSED_CONTROL + 100; const MILLIS_STREAMING_RESUMED_CONTROL = MILLIS_STREAMING_PAUSED_CONTROL + settings.scheduler.featuresRefreshRate + 100; -const MILLIS_MEMBERSHIP_MS_UPDATE_EVENT_DURING_PUSH = MILLIS_STREAMING_RESUMED_CONTROL + 100; +const MILLIS_MEMBERSHIPS_MS_UPDATE_EVENT_DURING_PUSH = MILLIS_STREAMING_RESUMED_CONTROL + 100; -const MILLIS_STREAMING_PAUSED_CONTROL_2 = MILLIS_MEMBERSHIP_MS_UPDATE_EVENT_DURING_PUSH + 100; +const MILLIS_STREAMING_PAUSED_CONTROL_2 = MILLIS_MEMBERSHIPS_MS_UPDATE_EVENT_DURING_PUSH + 100; const MILLIS_STREAMING_RESET_WHILE_PUSH_DOWN = MILLIS_STREAMING_PAUSED_CONTROL_2 + 100; const MILLIS_STREAMING_RESET_WHILE_PUSH_UP = MILLIS_STREAMING_RESET_WHILE_PUSH_DOWN + settings.scheduler.featuresRefreshRate; const MILLIS_STREAMING_DISABLED_CONTROL = MILLIS_STREAMING_RESET_WHILE_PUSH_UP + 100; @@ -88,11 +88,11 @@ const MILLIS_DESTROY = MILLIS_STREAMING_DISABLED_CONTROL + settings.scheduler.fe * 0.55 secs: create a new client while streaming -> initial fetch (/memberships/marcio), auth, SSE connection and syncAll (/splitChanges, /memberships/nicolas, /memberships/marcio) * 0.6 secs: SPLIT_UPDATE event -> /splitChanges * 0.7 secs: Streaming down (CONTROL event) -> fetch due to fallback to polling (/splitChanges, /memberships/nicolas, /memberships/marcio) - * 0.8 secs: MEMBERSHIP_MS_UPDATE event ignored + * 0.8 secs: MEMBERSHIPS_MS_UPDATE event ignored * 0.9 secs: periodic fetch due to polling (/splitChanges) * 0.95 secs: periodic fetch due to polling (/memberships/nicolas, /memberships/marcio) * 1.0 secs: Streaming up (CONTROL event) -> syncAll (/splitChanges, /memberships/nicolas, /memberships/marcio) - * 1.1 secs: Unbounded MEMBERSHIP_MS_UPDATE event -> /memberships/nicolas, /memberships/marcio + * 1.1 secs: Unbounded MEMBERSHIPS_MS_UPDATE event -> /memberships/nicolas, /memberships/marcio * 1.2 secs: Streaming down (CONTROL event) -> fetch due to fallback to polling (/splitChanges, /memberships/nicolas, /memberships/marcio) * 1.3 secs: STREAMING_RESET control event -> auth, SSE connection, syncAll and stop polling * 1.5 secs: STREAMING_RESET control event -> auth, SSE connection, syncAll @@ -110,7 +110,7 @@ export function testFallback(fetchMock, assert) { // mock SSE open and message events setMockListener((eventSourceInstance) => { - const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_NTcwOTc3MDQx_mySegments,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_splits,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolas.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; + const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_control,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_flags,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_memberships,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolas.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; assert.equals(eventSourceInstance.url, expectedSSEurl, 'EventSource URL is the expected'); setTimeout(() => { @@ -136,7 +136,7 @@ export function testFallback(fetchMock, assert) { secondClient = splitio.client(secondUserKey); setMockListener((eventSourceInstance) => { - const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_MjE0MTkxOTU2Mg%3D%3D_mySegments,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_NTcwOTc3MDQx_mySegments,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_splits,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolasAndMarcio.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; + const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_control,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_flags,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_memberships,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolasAndMarcio.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; assert.equals(eventSourceInstance.url, expectedSSEurl, 'new EventSource URL is the expected'); eventSourceInstance.emitOpen(); @@ -155,7 +155,7 @@ export function testFallback(fetchMock, assert) { setTimeout(() => { assert.equal(eventSourceInstance.readyState, EventSourceMock.OPEN, 'EventSource connection keeps opened after PUSH_SUBSYSTEM_DOWN (STREAMING_PAUSED event)'); eventSourceInstance.emitMessage(mySegmentsUpdateMessage); - }, MILLIS_MEMBERSHIP_MS_UPDATE_EVENT_DURING_POLLING - MILLIS_CREATE_CLIENT_DURING_PUSH); // send a MEMBERSHIP_MS_UPDATE event while polling, to check that we are ignoring it + }, MILLIS_MEMBERSHIPS_MS_UPDATE_EVENT_DURING_POLLING - MILLIS_CREATE_CLIENT_DURING_PUSH); // send a MEMBERSHIPS_MS_UPDATE event while polling, to check that we are ignoring it setTimeout(() => { eventSourceInstance.emitMessage(streamingResumedControlPriMessage); @@ -167,7 +167,7 @@ export function testFallback(fetchMock, assert) { assert.equal(client.getTreatment('real_split'), 'on', 'evaluation with updated segment'); }); eventSourceInstance.emitMessage(mySegmentsUpdateMessage); - }, MILLIS_MEMBERSHIP_MS_UPDATE_EVENT_DURING_PUSH - MILLIS_CREATE_CLIENT_DURING_PUSH); // send a MEMBERSHIP_MS_UPDATE event + }, MILLIS_MEMBERSHIPS_MS_UPDATE_EVENT_DURING_PUSH - MILLIS_CREATE_CLIENT_DURING_PUSH); // send a MEMBERSHIPS_MS_UPDATE event setTimeout(() => { eventSourceInstance.emitMessage(streamingPausedControlPriMessage2); @@ -271,10 +271,10 @@ export function testFallback(fetchMock, assert) { fetchMock.getOnce(url(settings, '/memberships/nicolas%40split.io'), { status: 200, body: membershipsNicolasMock1 }); fetchMock.getOnce(url(settings, '/memberships/marcio%40split.io'), { status: 200, body: membershipsMarcio }); - // fetch due to MEMBERSHIP_MS_UPDATE event + // fetch due to MEMBERSHIPS_MS_UPDATE event fetchMock.getOnce(url(settings, '/memberships/nicolas%40split.io'), function () { const lapse = Date.now() - start; - assert.true(nearlyEqual(lapse, MILLIS_MEMBERSHIP_MS_UPDATE_EVENT_DURING_PUSH), 'sync due to MEMBERSHIP_MS_UPDATE event'); + assert.true(nearlyEqual(lapse, MILLIS_MEMBERSHIPS_MS_UPDATE_EVENT_DURING_PUSH), 'sync due to MEMBERSHIPS_MS_UPDATE event'); return { status: 200, body: membershipsNicolasMock2 }; }); fetchMock.getOnce(url(settings, '/memberships/marcio%40split.io'), { status: 200, body: membershipsMarcio }); diff --git a/src/__tests__/browserSuites/push-initialization-retries.spec.js b/src/__tests__/browserSuites/push-initialization-retries.spec.js index 49dc6295e..027ceceaa 100644 --- a/src/__tests__/browserSuites/push-initialization-retries.spec.js +++ b/src/__tests__/browserSuites/push-initialization-retries.spec.js @@ -114,7 +114,7 @@ export function testPushRetriesDueToSseErrors(fetchMock, assert) { let start, splitio, client, ready = false; const expectedTimeToSSEsuccess = (settings.scheduler.pushRetryBackoffBase * Math.pow(2, 0) + settings.scheduler.pushRetryBackoffBase * Math.pow(2, 1)); - const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_NTcwOTc3MDQx_mySegments,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_splits,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolas.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; + const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_control,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_flags,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_memberships,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolas.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; let sseattempts = 0; setMockListener(function (eventSourceInstance) { assert.equal(eventSourceInstance.url, expectedSSEurl, 'SSE url is correct'); diff --git a/src/__tests__/browserSuites/push-synchronization-retries.spec.js b/src/__tests__/browserSuites/push-synchronization-retries.spec.js index 65df72b41..a24236503 100644 --- a/src/__tests__/browserSuites/push-synchronization-retries.spec.js +++ b/src/__tests__/browserSuites/push-synchronization-retries.spec.js @@ -7,7 +7,7 @@ import membershipsMarcio from '../mocks/memberships.marcio@split.io.json'; import splitUpdateMessage from '../mocks/message.SPLIT_UPDATE.1457552649999.json'; import oldSplitUpdateMessage from '../mocks/message.SPLIT_UPDATE.1457552620999.json'; -import mySegmentsUpdateMessage from '../mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552640000.json'; +import mySegmentsUpdateMessage from '../mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552640000.json'; import splitKillMessage from '../mocks/message.SPLIT_KILL.1457552650000.json'; import authPushEnabledNicolas from '../mocks/auth.pushEnabled.nicolas@split.io.json'; @@ -48,8 +48,8 @@ const MILLIS_RETRY_FOR_FIRST_SPLIT_UPDATE_EVENT = 300; const MILLIS_SECOND_SPLIT_UPDATE_EVENT = 400; -const MILLIS_MYSEGMENTS_UPDATE_V3_EVENT = 500; -const MILLIS_THIRD_RETRY_FOR_MYSEGMENT_UPDATE_EVENT = 1200; +const MILLIS_MEMBERSHIPS_MS_UPDATE = 500; +const MILLIS_THIRD_RETRY_FOR_MEMBERSHIPS_MS_UPDATE = 1200; const MILLIS_SPLIT_KILL_EVENT = 1300; const MILLIS_THIRD_RETRY_FOR_SPLIT_KILL_EVENT = 2000; @@ -64,10 +64,10 @@ const MILLIS_THIRD_RETRY_FOR_SPLIT_KILL_EVENT = 2000; * * 0.4 secs: SPLIT_UPDATE event with old changeNumber -> SDK_UPDATE not triggered * - * 0.5 secs: Unbounded MEMBERSHIP_MS_UPDATE event -> /memberships/marcio@split.io OK, /memberships/nicolas@split.io: network error - * 0.6 secs: Unbounded MEMBERSHIP_MS_UPDATE event -> /memberships/nicolas@split.io retry: invalid JSON response - * 0.8 secs: Unbounded MEMBERSHIP_MS_UPDATE event -> /memberships/nicolas@split.io: server error - * 1.2 secs: Unbounded MEMBERSHIP_MS_UPDATE event -> /memberships/nicolas@split.io retry: success -> SDK_UPDATE triggered + * 0.5 secs: Unbounded MEMBERSHIPS_MS_UPDATE event -> /memberships/marcio@split.io OK, /memberships/nicolas@split.io: network error + * 0.6 secs: Unbounded MEMBERSHIPS_MS_UPDATE event -> /memberships/nicolas@split.io retry: invalid JSON response + * 0.8 secs: Unbounded MEMBERSHIPS_MS_UPDATE event -> /memberships/nicolas@split.io: server error + * 1.2 secs: Unbounded MEMBERSHIPS_MS_UPDATE event -> /memberships/nicolas@split.io retry: success -> SDK_UPDATE triggered * * 1.3 secs: SPLIT_KILL event -> /splitChanges: outdated response -> SDK_UPDATE triggered although fetches fail * 1.4 secs: SPLIT_KILL event -> /splitChanges retry: network error @@ -88,7 +88,7 @@ export function testSynchronizationRetries(fetchMock, assert) { setMockListener(function (eventSourceInstance) { start = Date.now(); - const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_NTcwOTc3MDQx_mySegments,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_splits,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolas.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; + const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_control,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_flags,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_memberships,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolas.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; assert.equals(eventSourceInstance.url, expectedSSEurl, 'EventSource URL is the expected'); /* events on first SSE connection */ @@ -114,11 +114,11 @@ export function testSynchronizationRetries(fetchMock, assert) { assert.equal(client.getTreatment('splitters'), 'off', 'evaluation with initial MySegments list'); client.once(client.Event.SDK_UPDATE, () => { const lapse = Date.now() - start; - assert.true(nearlyEqual(lapse, MILLIS_THIRD_RETRY_FOR_MYSEGMENT_UPDATE_EVENT), 'SDK_UPDATE due to MEMBERSHIP_MS_UPDATE event'); + assert.true(nearlyEqual(lapse, MILLIS_THIRD_RETRY_FOR_MEMBERSHIPS_MS_UPDATE), 'SDK_UPDATE due to MEMBERSHIPS_MS_UPDATE event'); assert.equal(client.getTreatment('splitters'), 'on', 'evaluation with updated MySegments list'); }); eventSourceInstance.emitMessage(mySegmentsUpdateMessage); - }, MILLIS_MYSEGMENTS_UPDATE_V3_EVENT); // send a MEMBERSHIP_MS_UPDATE event with a new changeNumber after 0.4 seconds + }, MILLIS_MEMBERSHIPS_MS_UPDATE); // send a MEMBERSHIPS_MS_UPDATE event with a new changeNumber after 0.4 seconds setTimeout(() => { client.once(client.Event.SDK_UPDATE, () => { @@ -163,16 +163,16 @@ export function testSynchronizationRetries(fetchMock, assert) { return { status: 200, body: splitChangesMock3 }; }); - // fetch due to first MEMBERSHIP_MS_UPDATE event + // fetch due to first MEMBERSHIPS_MS_UPDATE event fetchMock.getOnce(url(settings, '/memberships/nicolas%40split.io'), { throws: new TypeError('Network error') }); - // fetch retry for MEMBERSHIP_MS_UPDATE event, due to previous fail + // fetch retry for MEMBERSHIPS_MS_UPDATE event, due to previous fail fetchMock.getOnce(url(settings, '/memberships/nicolas%40split.io'), { status: 200, body: '{ "since": 1457552620999, "til' }); // invalid JSON response - // fetch retry for MEMBERSHIP_MS_UPDATE event, due to previous fail + // fetch retry for MEMBERSHIPS_MS_UPDATE event, due to previous fail fetchMock.getOnce(url(settings, '/memberships/nicolas%40split.io'), { status: 500, body: 'server error' }); - // second fetch retry for MEMBERSHIP_MS_UPDATE event, due to previous fail + // second fetch retry for MEMBERSHIPS_MS_UPDATE event, due to previous fail fetchMock.getOnce(url(settings, '/memberships/nicolas%40split.io'), function () { const lapse = Date.now() - start; - assert.true(nearlyEqual(lapse, MILLIS_THIRD_RETRY_FOR_MYSEGMENT_UPDATE_EVENT), 'sync second retry for MEMBERSHIP_MS_UPDATE event'); + assert.true(nearlyEqual(lapse, MILLIS_THIRD_RETRY_FOR_MEMBERSHIPS_MS_UPDATE), 'sync second retry for MEMBERSHIPS_MS_UPDATE event'); return { status: 200, body: membershipsNicolasMock2 }; }); diff --git a/src/__tests__/browserSuites/push-synchronization.spec.js b/src/__tests__/browserSuites/push-synchronization.spec.js index ad9400e1a..783197f47 100644 --- a/src/__tests__/browserSuites/push-synchronization.spec.js +++ b/src/__tests__/browserSuites/push-synchronization.spec.js @@ -9,12 +9,12 @@ import splitUpdateMessage from '../mocks/message.SPLIT_UPDATE.1457552649999.json import oldSplitUpdateMessage from '../mocks/message.SPLIT_UPDATE.1457552620999.json'; import splitKillMessage from '../mocks/message.SPLIT_KILL.1457552650000.json'; -import unboundedMessage from '../mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552650000.json'; -import boundedZlibMessage from '../mocks/message.MEMBERSHIP_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json'; -import keylistGzipMessage from '../mocks/message.MEMBERSHIP_MS_UPDATE.KEYLIST.GZIP.1457552652000.json'; -import segmentRemovalMessage from '../mocks/message.MEMBERSHIP_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json'; -import unboundedMyLargeSegmentsMessage from '../mocks/message.MEMBERSHIP_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json'; -import myLargeSegmentRemovalMessage from '../mocks/message.MEMBERSHIP_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json'; +import unboundedMessage from '../mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552650000.json'; +import boundedZlibMessage from '../mocks/message.MEMBERSHIPS_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json'; +import keylistGzipMessage from '../mocks/message.MEMBERSHIPS_MS_UPDATE.KEYLIST.GZIP.1457552652000.json'; +import segmentRemovalMessage from '../mocks/message.MEMBERSHIPS_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json'; +import unboundedMyLargeSegmentsMessage from '../mocks/message.MEMBERSHIPS_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json'; +import myLargeSegmentRemovalMessage from '../mocks/message.MEMBERSHIPS_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json'; import authPushEnabledNicolas from '../mocks/auth.pushEnabled.nicolas@split.io.json'; import authPushEnabledNicolasAndMarcio from '../mocks/auth.pushEnabled.nicolas@split.io.marcio@split.io.json'; @@ -57,14 +57,14 @@ const MILLIS_SPLIT_KILL_EVENT = 400; const MILLIS_NEW_CLIENT = 500; const MILLIS_SECOND_SSE_OPEN = 600; const MILLIS_MORE_CLIENTS = 700; -const MILLIS_UNBOUNDED_FETCH = 800; -const MILLIS_BOUNDED_FALLBACK = 900; -const MILLIS_KEYLIST_FALLBACK = 1000; -const MILLIS_BOUNDED = 1100; -const MILLIS_KEYLIST = 1200; -const MILLIS_SEGMENT_REMOVAL = 1300; -const MILLIS_UNBOUNDED_FETCH_LS = 1400; -const MILLIS_SEGMENT_REMOVAL_LS = 1800; +const MILLIS_MEMBERSHIPS_MS_UPDATE_UNBOUNDED_FETCH = 800; +const MILLIS_MEMBERSHIPS_MS_UPDATE_BOUNDED_FALLBACK = 900; +const MILLIS_MEMBERSHIPS_MS_UPDATE_KEYLIST_FALLBACK = 1000; +const MILLIS_MEMBERSHIPS_MS_UPDATE_BOUNDED = 1100; +const MILLIS_MEMBERSHIPS_MS_UPDATE_KEYLIST = 1200; +const MILLIS_MEMBERSHIPS_MS_UPDATE_SEGMENT_REMOVAL = 1300; +const MILLIS_MEMBERSHIPS_LS_UPDATE_UNBOUNDED_FETCH = 1400; +const MILLIS_MEMBERSHIPS_LS_UPDATE_SEGMENT_REMOVAL = 1800; /** * Sequence of calls: @@ -76,15 +76,16 @@ const MILLIS_SEGMENT_REMOVAL_LS = 1800; * 0.5 secs: creates a new client -> new auth and SSE connection * 0.6 secs: SSE connection opened -> syncAll (/splitChanges, /memberships/*) * 0.7 secs: creates more clients - * 0.8 secs: MEMBERSHIP_MS_UPDATE UnboundedFetchRequest event. - * 0.9 secs: MEMBERSHIP_MS_UPDATE BoundedFetchRequest event error --> UnboundedFetchRequest. - * 1.0 secs: MEMBERSHIP_MS_UPDATE KeyList event error --> UnboundedFetchRequest. - * 1.1 secs: MEMBERSHIP_MS_UPDATE BoundedFetchRequest event. - * 1.2 secs: MEMBERSHIP_MS_UPDATE KeyList event. - * 1.3 secs: MEMBERSHIP_MS_UPDATE SegmentRemoval event. - * 1.4 secs: MEMBERSHIP_LS_UPDATE UnboundedFetchRequest event, with 241 ms delay for 'nicolas@split.io' (hash('nicolas@split.io') % 300) - * 1.641 secs: /memberships/* fetch due to unbounded MEMBERSHIP_LS_UPDATE event -> SDK_UPDATE event - * 1.8 secs: MEMBERSHIP_LS_UPDATE SegmentRemoval event -> SPLIT_UPDATE event + * 0.8 secs: MEMBERSHIPS_MS_UPDATE UnboundedFetchRequest event. + * 0.9 secs: MEMBERSHIPS_MS_UPDATE BoundedFetchRequest event error --> UnboundedFetchRequest. + * 1.0 secs: MEMBERSHIPS_MS_UPDATE KeyList event error --> UnboundedFetchRequest. + * 1.1 secs: MEMBERSHIPS_MS_UPDATE BoundedFetchRequest event. + * 1.2 secs: MEMBERSHIPS_MS_UPDATE KeyList event. + * 1.3 secs: MEMBERSHIPS_MS_UPDATE SegmentRemoval event. +// WITH CN IN THE RESPONSE + * 1.4 secs: MEMBERSHIPS_LS_UPDATE UnboundedFetchRequest event, with 241 ms delay for 'nicolas@split.io' (hash('nicolas@split.io') % 300) + * 1.641 secs: /memberships/* fetch due to unbounded MEMBERSHIPS_LS_UPDATE event -> SDK_UPDATE event + * 1.8 secs: MEMBERSHIPS_LS_UPDATE SegmentRemoval event -> SPLIT_UPDATE event */ export function testSynchronization(fetchMock, assert) { assert.plan(34); @@ -94,7 +95,7 @@ export function testSynchronization(fetchMock, assert) { // mock SSE open and message events setMockListener((eventSourceInstance) => { - const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_NTcwOTc3MDQx_mySegments,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_splits,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolas.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; + const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_control,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_flags,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_memberships,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolas.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; assert.equals(eventSourceInstance.url, expectedSSEurl, 'EventSource URL is the expected'); /* events on first SSE connection */ @@ -133,7 +134,7 @@ export function testSynchronization(fetchMock, assert) { otherClient = splitio.client(otherUserKey); setMockListener((eventSourceInstance) => { - const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_MjE0MTkxOTU2Mg%3D%3D_mySegments,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_NTcwOTc3MDQx_mySegments,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_splits,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolasAndMarcio.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; + const expectedSSEurl = `${url(settings, '/sse')}?channels=NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_control,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_flags,NzM2MDI5Mzc0_NDEzMjQ1MzA0Nw%3D%3D_memberships,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_pri,%5B%3Foccupancy%3Dmetrics.publishers%5Dcontrol_sec&accessToken=${authPushEnabledNicolasAndMarcio.token}&v=1.1&heartbeats=true&SplitSDKVersion=${settings.version}&SplitSDKClientKey=h-1>`; assert.equals(eventSourceInstance.url, expectedSSEurl, 'new EventSource URL is the expected'); /* events on second SSE connection */ @@ -152,17 +153,17 @@ export function testSynchronization(fetchMock, assert) { setTimeout(() => { eventSourceInstance.emitMessage(unboundedMessage); - }, MILLIS_UNBOUNDED_FETCH - MILLIS_MORE_CLIENTS); + }, MILLIS_MEMBERSHIPS_MS_UPDATE_UNBOUNDED_FETCH - MILLIS_MORE_CLIENTS); setTimeout(() => { const malformedMessage = { ...boundedZlibMessage, data: boundedZlibMessage.data.replace('eJxiGAX4AMd', '').replace('1457552651000', '1457552650100') }; eventSourceInstance.emitMessage(malformedMessage); - }, MILLIS_BOUNDED_FALLBACK - MILLIS_MORE_CLIENTS); + }, MILLIS_MEMBERSHIPS_MS_UPDATE_BOUNDED_FALLBACK - MILLIS_MORE_CLIENTS); setTimeout(() => { const malformedMessage = { ...keylistGzipMessage, data: keylistGzipMessage.data.replace('H4sIAAAAAAA', '').replace('1457552652000', '1457552650200') }; eventSourceInstance.emitMessage(malformedMessage); - }, MILLIS_KEYLIST_FALLBACK - MILLIS_MORE_CLIENTS); + }, MILLIS_MEMBERSHIPS_MS_UPDATE_KEYLIST_FALLBACK - MILLIS_MORE_CLIENTS); setTimeout(() => { assert.deepEqual(sharedClients.map(c => c.getTreatment('splitters')), ['off', 'off', 'on', 'off'], 'evaluation before bounded fetch'); @@ -170,7 +171,7 @@ export function testSynchronization(fetchMock, assert) { assert.deepEqual(sharedClients.map(c => c.getTreatment('splitters')), ['off', 'off', 'on', 'on'], 'evaluation after bounded fetch'); }); eventSourceInstance.emitMessage(boundedZlibMessage); - }, MILLIS_BOUNDED - MILLIS_MORE_CLIENTS); + }, MILLIS_MEMBERSHIPS_MS_UPDATE_BOUNDED - MILLIS_MORE_CLIENTS); setTimeout(() => { assert.deepEqual(sharedClients.map(c => c.getTreatment('splitters')), ['off', 'off', 'on', 'on'], 'evaluation before keylist message'); @@ -182,7 +183,7 @@ export function testSynchronization(fetchMock, assert) { assert.deepEqual(sharedClients.map(c => c.getTreatment('splitters')), ['off', 'on', 'off', 'on'], 'evaluation after keylist message (removed key)'); }); eventSourceInstance.emitMessage(keylistGzipMessage); - }, MILLIS_KEYLIST - MILLIS_MORE_CLIENTS); + }, MILLIS_MEMBERSHIPS_MS_UPDATE_KEYLIST - MILLIS_MORE_CLIENTS); setTimeout(() => { assert.deepEqual(sharedClients.map(c => c.getTreatment('splitters')), ['off', 'on', 'off', 'on'], 'evaluation before segment removal'); @@ -191,7 +192,7 @@ export function testSynchronization(fetchMock, assert) { }); eventSourceInstance.emitMessage(segmentRemovalMessage); - }, MILLIS_SEGMENT_REMOVAL - MILLIS_MORE_CLIENTS); + }, MILLIS_MEMBERSHIPS_MS_UPDATE_SEGMENT_REMOVAL - MILLIS_MORE_CLIENTS); setTimeout(() => { assert.equal(client.getTreatment('in_large_segment'), 'no', 'evaluation before myLargeSegment fetch'); @@ -205,7 +206,7 @@ export function testSynchronization(fetchMock, assert) { }); eventSourceInstance.emitMessage(unboundedMyLargeSegmentsMessage); - }, MILLIS_UNBOUNDED_FETCH_LS - MILLIS_MORE_CLIENTS); + }, MILLIS_MEMBERSHIPS_LS_UPDATE_UNBOUNDED_FETCH - MILLIS_MORE_CLIENTS); setTimeout(() => { assert.equal(client.getTreatment('in_large_segment'), 'yes', 'evaluation before large segment removal'); @@ -230,7 +231,7 @@ export function testSynchronization(fetchMock, assert) { }); eventSourceInstance.emitMessage(myLargeSegmentRemovalMessage); - }, MILLIS_SEGMENT_REMOVAL_LS - MILLIS_MORE_CLIENTS); + }, MILLIS_MEMBERSHIPS_LS_UPDATE_SEGMENT_REMOVAL - MILLIS_MORE_CLIENTS); }); }, MILLIS_MORE_CLIENTS - MILLIS_NEW_CLIENT); @@ -319,7 +320,7 @@ export function testSynchronization(fetchMock, assert) { return { status: 200, body: membershipsMarcio }; }); - // 3 unbounded fetch for MEMBERSHIP_MS_UPDATE + 1 unbounded fetch for MEMBERSHIP_LS_UPDATE + // 3 unbounded fetch for MEMBERSHIPS_MS_UPDATE + 1 unbounded fetch for MEMBERSHIPS_LS_UPDATE fetchMock.get({ url: url(settings, '/memberships/nicolas%40split.io'), repeat: 3 }, function (url, opts) { if (!hasNoCacheHeader(opts)) assert.fail('request must not include `Cache-Control` header'); return { status: 200, body: membershipsNicolasMock2 }; @@ -330,7 +331,7 @@ export function testSynchronization(fetchMock, assert) { return { status: 200, body: membershipsMarcio }; }); - // initial fetch of memberships for other clients + sync all after third SSE opened + 3 unbounded fetch for MEMBERSHIP_MS_UPDATE + 1 unbounded fetch for MEMBERSHIP_LS_UPDATE + // initial fetch of memberships for other clients + sync all after third SSE opened + 3 unbounded fetch for MEMBERSHIPS_MS_UPDATE + 1 unbounded fetch for MEMBERSHIPS_LS_UPDATE fetchMock.getOnce(url(settings, '/splitChanges?s=1.2&since=1457552650000'), { status: 200, body: { splits: [], since: 1457552650000, till: 1457552650000 } }); fetchMock.get({ url: url(settings, '/memberships/key1'), repeat: 6 }, { status: 200, body: { ms: {} } }); fetchMock.get({ url: url(settings, '/memberships/key3'), repeat: 6 }, { status: 200, body: { ms: { k: [{ n: 'splitters' }] } } }); diff --git a/src/__tests__/browserSuites/readiness.spec.js b/src/__tests__/browserSuites/readiness.spec.js index 9ed15d8a0..8bc7dada8 100644 --- a/src/__tests__/browserSuites/readiness.spec.js +++ b/src/__tests__/browserSuites/readiness.spec.js @@ -199,7 +199,7 @@ export default function (fetchMock, assert) { t.equal(getMembershipsHits(), 2 * CLIENTS_COUNT - 1, 'It should have tried to synchronize memberships as soon as it received a new Split with segments.'); }, 0); - setTimeout(() => { // Nasty ugly crap to avoid listening to the update coming from mySegment calls. + setTimeout(() => { // Nasty ugly code to avoid listening to the update coming from membership calls. client.once(client.Event.SDK_UPDATE, () => { setTimeout(() => { // This update left us in an state with no segments (removed the matcher we fetched on the previous one), it should stop the producer and not trigger more requests. @@ -283,7 +283,7 @@ export default function (fetchMock, assert) { t.equal(getMembershipsHits(), 2 * CLIENTS_COUNT - 1, 'It should have tried to synchronize memberships as soon as it received a new Split with segments.'); }, 0); - setTimeout(() => { // Nasty ugly crap to avoid listening to the update coming from mySegment calls. + setTimeout(() => { // Nasty ugly code to avoid listening to the update coming from membership calls. client.once(client.Event.SDK_UPDATE, () => { setTimeout(() => { // This update left us in an state with no segments (removed the matcher we fetched on the previous one), it should stop the producer and not trigger more requests. diff --git a/src/__tests__/mocks/auth.pushEnabled.nicolas@split.io.json b/src/__tests__/mocks/auth.pushEnabled.nicolas@split.io.json index 3930e1d09..d7b68e966 100644 --- a/src/__tests__/mocks/auth.pushEnabled.nicolas@split.io.json +++ b/src/__tests__/mocks/auth.pushEnabled.nicolas@split.io.json @@ -1,5 +1,5 @@ { "pushEnabled": true, - "token": "eyJhbGciOiJIUzI1NiIsImtpZCI6IjVZOU05US45QnJtR0EiLCJ0eXAiOiJKV1QifQ.eyJ4LWFibHktY2FwYWJpbGl0eSI6IntcIk56TTJNREk1TXpjMF9OREV6TWpRMU16QTBOdz09X05UY3dPVGMzTURReF9teVNlZ21lbnRzXCI6W1wic3Vic2NyaWJlXCJdLFwiTnpNMk1ESTVNemMwX05ERXpNalExTXpBME53PT1fc3BsaXRzXCI6W1wic3Vic2NyaWJlXCJdLFwiY29udHJvbF9wcmlcIjpbXCJzdWJzY3JpYmVcIixcImNoYW5uZWwtbWV0YWRhdGE6cHVibGlzaGVyc1wiXSxcImNvbnRyb2xfc2VjXCI6W1wic3Vic2NyaWJlXCIsXCJjaGFubmVsLW1ldGFkYXRhOnB1Ymxpc2hlcnNcIl19IiwieC1hYmx5LWNsaWVudElkIjoiY2xpZW50SWQiLCJleHAiOjE1ODY5MTU3NjksImlhdCI6MTU4NjkxMjE2OX0.iq6k65WcCx8s-yqDj4FpIOUEP6-G3VdB-NLhR0fXQUw", + "token": "eyJhbGciOiJIUzI1NiIsImtpZCI6IjVZOU05US5MZzMtZWciLCJ0eXAiOiJKV1QifQ.eyJ4LWFibHktY2FwYWJpbGl0eSI6IntcIk56TTJNREk1TXpjMF9OREV6TWpRMU16QTBOdz09X2NvbnRyb2xcIjpbXCJzdWJzY3JpYmVcIl0sXCJOek0yTURJNU16YzBfTkRFek1qUTFNekEwTnc9PV9mbGFnc1wiOltcInN1YnNjcmliZVwiXSxcIk56TTJNREk1TXpjMF9OREV6TWpRMU16QTBOdz09X21lbWJlcnNoaXBzXCI6W1wic3Vic2NyaWJlXCJdLFwiY29udHJvbF9wcmlcIjpbXCJzdWJzY3JpYmVcIixcImNoYW5uZWwtbWV0YWRhdGE6cHVibGlzaGVyc1wiXSxcImNvbnRyb2xfc2VjXCI6W1wic3Vic2NyaWJlXCIsXCJjaGFubmVsLW1ldGFkYXRhOnB1Ymxpc2hlcnNcIl19IiwieC1hYmx5LWNsaWVudElkIjoiY2xpZW50SWQiLCJleHAiOjE3MjUzODM2NDEsImlhdCI6MTcyNTM4MDA0MX0.Qqyixo2ZG-2tAkxjad7O-iphK3DVK5_xICypbIDh3IM", "connDelay": 0 } \ No newline at end of file diff --git a/src/__tests__/mocks/auth.pushEnabled.nicolas@split.io.marcio@split.io.json b/src/__tests__/mocks/auth.pushEnabled.nicolas@split.io.marcio@split.io.json index 8ed677bbe..e266b5928 100644 --- a/src/__tests__/mocks/auth.pushEnabled.nicolas@split.io.marcio@split.io.json +++ b/src/__tests__/mocks/auth.pushEnabled.nicolas@split.io.marcio@split.io.json @@ -1,5 +1,5 @@ { "pushEnabled": true, - "token": "eyJhbGciOiJIUzI1NiIsImtpZCI6IjVZOU05US45QnJtR0EiLCJ0eXAiOiJKV1QifQ.eyJ4LWFibHktY2FwYWJpbGl0eSI6IntcIk56TTJNREk1TXpjMF9OREV6TWpRMU16QTBOdz09X01qRTBNVGt4T1RVMk1nPT1fbXlTZWdtZW50c1wiOltcInN1YnNjcmliZVwiXSxcIk56TTJNREk1TXpjMF9OREV6TWpRMU16QTBOdz09X05UY3dPVGMzTURReF9teVNlZ21lbnRzXCI6W1wic3Vic2NyaWJlXCJdLFwiTnpNMk1ESTVNemMwX05ERXpNalExTXpBME53PT1fc3BsaXRzXCI6W1wic3Vic2NyaWJlXCJdLFwiY29udHJvbF9wcmlcIjpbXCJzdWJzY3JpYmVcIixcImNoYW5uZWwtbWV0YWRhdGE6cHVibGlzaGVyc1wiXSxcImNvbnRyb2xfc2VjXCI6W1wic3Vic2NyaWJlXCIsXCJjaGFubmVsLW1ldGFkYXRhOnB1Ymxpc2hlcnNcIl19IiwieC1hYmx5LWNsaWVudElkIjoiY2xpZW50SWQiLCJleHAiOjE1ODY5MTYyMDAsImlhdCI6MTU4NjkxMjYwMH0.iq6k65WcCx8s-yqDj4FpIOUEP6-G3VdB-NLhR0fXQUw", + "token": "eyJhbGciOiJIUzI1NiIsImtpZCI6IjVZOU05US5MZzMtZWciLCJ0eXAiOiJKV1QifQ.eyJ4LWFibHktY2FwYWJpbGl0eSI6IntcIk56TTJNREk1TXpjMF9OREV6TWpRMU16QTBOdz09X2NvbnRyb2xcIjpbXCJzdWJzY3JpYmVcIl0sXCJOek0yTURJNU16YzBfTkRFek1qUTFNekEwTnc9PV9mbGFnc1wiOltcInN1YnNjcmliZVwiXSxcIk56TTJNREk1TXpjMF9OREV6TWpRMU16QTBOdz09X21lbWJlcnNoaXBzXCI6W1wic3Vic2NyaWJlXCJdLFwiY29udHJvbF9wcmlcIjpbXCJzdWJzY3JpYmVcIixcImNoYW5uZWwtbWV0YWRhdGE6cHVibGlzaGVyc1wiXSxcImNvbnRyb2xfc2VjXCI6W1wic3Vic2NyaWJlXCIsXCJjaGFubmVsLW1ldGFkYXRhOnB1Ymxpc2hlcnNcIl19IiwieC1hYmx5LWNsaWVudElkIjoiY2xpZW50SWQiLCJleHAiOjE3MjUzODk4MjgsImlhdCI6MTcyNTM4NjIyOH0.KaEa6CjNM489dLgHxDbL8RP1DUFCMtkGLI6W3JZcTTs", "connDelay": 0 } \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIPS_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json b/src/__tests__/mocks/message.MEMBERSHIPS_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json new file mode 100644 index 000000000..baa24fe3f --- /dev/null +++ b/src/__tests__/mocks/message.MEMBERSHIPS_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json @@ -0,0 +1,4 @@ +{ + "type": "message", + "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIPS_LS_UPDATE\\\",\\\"cn\\\":1457552653000,\\\"n\\\":[\\\"splitters\\\"],\\\"c\\\": 0,\\\"u\\\": 3,\\\"d\\\":\\\"\\\"}\"}" +} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIPS_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json b/src/__tests__/mocks/message.MEMBERSHIPS_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json new file mode 100644 index 000000000..99c839cb0 --- /dev/null +++ b/src/__tests__/mocks/message.MEMBERSHIPS_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json @@ -0,0 +1,4 @@ +{ + "type": "message", + "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIPS_LS_UPDATE\\\",\\\"cn\\\":1457552650000,\\\"n\\\":[],\\\"c\\\": 0,\\\"u\\\": 0,\\\"d\\\":\\\"\\\",\\\"i\\\":300,\\\"h\\\":1,\\\"s\\\":0}\"}" +} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.BOUNDED.GZIP.1457552651000.json b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.BOUNDED.GZIP.1457552651000.json new file mode 100644 index 000000000..59da6ea6f --- /dev/null +++ b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.BOUNDED.GZIP.1457552651000.json @@ -0,0 +1,4 @@ +{ + "type": "message", + "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIPS_MS_UPDATE\\\",\\\"cn\\\":1457552651000,\\\"n\\\":[],\\\"c\\\": 1,\\\"u\\\": 1,\\\"d\\\":\\\"H4sIAAAAAAAA/2JABxzYeIxQLguYFIBLN8Bl4EABjc+EzOnAsA4QAAD//8YBvWeAAAAA\\\",\\\"h\\\":0}\"}" +} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json new file mode 100644 index 000000000..fe4ff5a38 --- /dev/null +++ b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json @@ -0,0 +1,4 @@ +{ + "type": "message", + "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIPS_MS_UPDATE\\\",\\\"cn\\\":1457552651000,\\\"n\\\":[],\\\"c\\\": 2,\\\"u\\\": 1,\\\"d\\\":\\\"eJxiGAX4AMdAO2AU4AeMA+2AAQACA+0AuoORGMvDBDANtAPoDBQG2gGDGQz16pRloB0wCkbBKBgFo4As0EBYyZCqoojwDwEACAAA//+W/QFR\\\",\\\"h\\\":0}\"}" +} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.KEYLIST.GZIP.1457552652000.json b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.KEYLIST.GZIP.1457552652000.json new file mode 100644 index 000000000..320522553 --- /dev/null +++ b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.KEYLIST.GZIP.1457552652000.json @@ -0,0 +1,4 @@ +{ + "type": "message", + "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIPS_MS_UPDATE\\\",\\\"cn\\\":1457552652000,\\\"n\\\":[\\\"splitters\\\"],\\\"c\\\": 1,\\\"u\\\": 2,\\\"d\\\":\\\"H4sIAAAAAAAA/wTAsRHDUAgD0F2ofwEIkPAqPhdZIW0uu/v97GPXHU004ULuMGrYR6XUbIjlXULPPse+dt1yhJibBODjrTmj3GJ4emduuDDP/w0AAP//18WLsl0AAAA=\\\",\\\"h\\\":0}\"}" +} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json new file mode 100644 index 000000000..23e582775 --- /dev/null +++ b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json @@ -0,0 +1,4 @@ +{ + "type": "message", + "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIPS_MS_UPDATE\\\",\\\"cn\\\":1457552653000,\\\"n\\\":[\\\"splitters\\\"],\\\"c\\\": 0,\\\"u\\\": 3,\\\"d\\\":\\\"\\\",\\\"h\\\":0}\"}" +} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552640000.json b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552640000.json new file mode 100644 index 000000000..dcce251be --- /dev/null +++ b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552640000.json @@ -0,0 +1,4 @@ +{ + "type": "message", + "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIPS_MS_UPDATE\\\",\\\"cn\\\":1457552640000,\\\"u\\\": 0,\\\"h\\\":0}\"}" +} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552650000.json b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552650000.json new file mode 100644 index 000000000..a69df9dd9 --- /dev/null +++ b/src/__tests__/mocks/message.MEMBERSHIPS_MS_UPDATE.UNBOUNDED.1457552650000.json @@ -0,0 +1,4 @@ +{ + "type": "message", + "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIPS_MS_UPDATE\\\",\\\"cn\\\":1457552650000,\\\"n\\\":[],\\\"c\\\": 0,\\\"u\\\": 0,\\\"d\\\":\\\"\\\",\\\"h\\\":0}\"}" +} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIP_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json b/src/__tests__/mocks/message.MEMBERSHIP_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json deleted file mode 100644 index 28540e802..000000000 --- a/src/__tests__/mocks/message.MEMBERSHIP_LS_UPDATE.SEGMENT_REMOVAL.1457552653000.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "message", - "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIP_LS_UPDATE\\\",\\\"cn\\\":1457552653000,\\\"n\\\":[\\\"splitters\\\"],\\\"c\\\": 0,\\\"u\\\": 3,\\\"d\\\":\\\"\\\"}\"}" -} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIP_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json b/src/__tests__/mocks/message.MEMBERSHIP_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json deleted file mode 100644 index 9b3493588..000000000 --- a/src/__tests__/mocks/message.MEMBERSHIP_LS_UPDATE.UNBOUNDED.DELAY.1457552650000.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "message", - "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIP_LS_UPDATE\\\",\\\"cn\\\":1457552650000,\\\"n\\\":[],\\\"c\\\": 0,\\\"u\\\": 0,\\\"d\\\":\\\"\\\",\\\"i\\\":300,\\\"h\\\":1,\\\"s\\\":0}\"}" -} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.BOUNDED.GZIP.1457552651000.json b/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.BOUNDED.GZIP.1457552651000.json deleted file mode 100644 index 7f4e53b31..000000000 --- a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.BOUNDED.GZIP.1457552651000.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "message", - "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIP_MS_UPDATE\\\",\\\"cn\\\":1457552651000,\\\"n\\\":[],\\\"c\\\": 1,\\\"u\\\": 1,\\\"d\\\":\\\"H4sIAAAAAAAA/2JABxzYeIxQLguYFIBLN8Bl4EABjc+EzOnAsA4QAAD//8YBvWeAAAAA\\\",\\\"h\\\":0}\"}" -} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json b/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json deleted file mode 100644 index 88dae3cb7..000000000 --- a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.BOUNDED.ZLIB.1457552651000.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "message", - "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIP_MS_UPDATE\\\",\\\"cn\\\":1457552651000,\\\"n\\\":[],\\\"c\\\": 2,\\\"u\\\": 1,\\\"d\\\":\\\"eJxiGAX4AMdAO2AU4AeMA+2AAQACA+0AuoORGMvDBDANtAPoDBQG2gGDGQz16pRloB0wCkbBKBgFo4As0EBYyZCqoojwDwEACAAA//+W/QFR\\\",\\\"h\\\":0}\"}" -} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.KEYLIST.GZIP.1457552652000.json b/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.KEYLIST.GZIP.1457552652000.json deleted file mode 100644 index c9cb0b904..000000000 --- a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.KEYLIST.GZIP.1457552652000.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "message", - "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIP_MS_UPDATE\\\",\\\"cn\\\":1457552652000,\\\"n\\\":[\\\"splitters\\\"],\\\"c\\\": 1,\\\"u\\\": 2,\\\"d\\\":\\\"H4sIAAAAAAAA/wTAsRHDUAgD0F2ofwEIkPAqPhdZIW0uu/v97GPXHU004ULuMGrYR6XUbIjlXULPPse+dt1yhJibBODjrTmj3GJ4emduuDDP/w0AAP//18WLsl0AAAA=\\\",\\\"h\\\":0}\"}" -} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json b/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json deleted file mode 100644 index 55def7a16..000000000 --- a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.SEGMENT_REMOVAL.1457552653000.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "message", - "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIP_MS_UPDATE\\\",\\\"cn\\\":1457552653000,\\\"n\\\":[\\\"splitters\\\"],\\\"c\\\": 0,\\\"u\\\": 3,\\\"d\\\":\\\"\\\",\\\"h\\\":0}\"}" -} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552640000.json b/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552640000.json deleted file mode 100644 index ef1a218c6..000000000 --- a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552640000.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "message", - "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIP_MS_UPDATE\\\",\\\"cn\\\":1457552640000,\\\"u\\\": 0,\\\"h\\\":0}\"}" -} \ No newline at end of file diff --git a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552650000.json b/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552650000.json deleted file mode 100644 index 663d89c6b..000000000 --- a/src/__tests__/mocks/message.MEMBERSHIP_MS_UPDATE.UNBOUNDED.1457552650000.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "type": "message", - "data": "{\"data\":\"{\\\"type\\\":\\\"MEMBERSHIP_MS_UPDATE\\\",\\\"cn\\\":1457552650000,\\\"n\\\":[],\\\"c\\\": 0,\\\"u\\\": 0,\\\"d\\\":\\\"\\\",\\\"h\\\":0}\"}" -} \ No newline at end of file diff --git a/src/settings/defaults/version.js b/src/settings/defaults/version.js index 22f2f5139..e6877bf0d 100644 --- a/src/settings/defaults/version.js +++ b/src/settings/defaults/version.js @@ -1 +1 @@ -export const packageVersion = '10.27.1-rc.3'; +export const packageVersion = '10.27.1-rc.4';