@splitsoftware/splitio-commons 1.17.0 → 1.17.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.txt +6 -0
- package/cjs/evaluator/matchers/index.js +3 -1
- package/cjs/evaluator/matchers/large_segment.js +16 -0
- package/cjs/evaluator/matchers/matcherTypes.js +1 -0
- package/cjs/evaluator/matchersTransform/index.js +4 -1
- package/cjs/evaluator/matchersTransform/segment.js +3 -1
- package/cjs/logger/constants.js +2 -2
- package/cjs/logger/messages/info.js +1 -1
- package/cjs/logger/messages/warn.js +1 -1
- package/cjs/readiness/readinessManager.js +5 -6
- package/cjs/readiness/sdkReadinessManager.js +5 -6
- package/cjs/sdkClient/sdkClientMethodCS.js +2 -2
- package/cjs/sdkClient/sdkClientMethodCSWithTT.js +2 -2
- package/cjs/sdkFactory/index.js +1 -1
- package/cjs/services/splitApi.js +5 -5
- package/cjs/storages/AbstractSegmentsCacheSync.js +41 -12
- package/cjs/storages/AbstractSplitsCacheSync.js +2 -1
- package/cjs/storages/KeyBuilderCS.js +23 -5
- package/cjs/storages/dataLoader.js +1 -1
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +29 -52
- package/cjs/storages/inLocalStorage/index.js +6 -2
- package/cjs/storages/inMemory/InMemoryStorageCS.js +5 -0
- package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +9 -40
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +8 -8
- package/cjs/storages/inMemory/TelemetryCacheInMemory.js +7 -10
- package/cjs/storages/pluggable/inMemoryWrapper.js +1 -1
- package/cjs/sync/polling/fetchers/mySegmentsFetcher.js +5 -8
- package/cjs/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
- package/cjs/sync/polling/pollingManagerCS.js +1 -1
- package/cjs/sync/polling/syncTasks/mySegmentsSyncTask.js +2 -2
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +15 -21
- package/cjs/sync/streaming/AuthClient/index.js +1 -1
- package/cjs/sync/streaming/SSEHandler/index.js +3 -5
- package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +107 -48
- package/cjs/sync/streaming/constants.js +3 -3
- package/cjs/sync/streaming/parseUtils.js +14 -9
- package/cjs/sync/streaming/pushManager.js +69 -67
- package/cjs/utils/constants/index.js +5 -4
- package/cjs/utils/settingsValidation/index.js +2 -1
- package/esm/evaluator/matchers/index.js +3 -1
- package/esm/evaluator/matchers/large_segment.js +12 -0
- package/esm/evaluator/matchers/matcherTypes.js +1 -0
- package/esm/evaluator/matchersTransform/index.js +4 -1
- package/esm/evaluator/matchersTransform/segment.js +3 -1
- package/esm/logger/constants.js +1 -1
- package/esm/logger/messages/info.js +1 -1
- package/esm/logger/messages/warn.js +1 -1
- package/esm/readiness/readinessManager.js +5 -6
- package/esm/readiness/sdkReadinessManager.js +5 -6
- package/esm/sdkClient/sdkClientMethodCS.js +2 -2
- package/esm/sdkClient/sdkClientMethodCSWithTT.js +2 -2
- package/esm/sdkFactory/index.js +1 -1
- package/esm/services/splitApi.js +6 -6
- package/esm/storages/AbstractSegmentsCacheSync.js +41 -12
- package/esm/storages/AbstractSplitsCacheSync.js +3 -2
- package/esm/storages/KeyBuilderCS.js +21 -4
- package/esm/storages/dataLoader.js +1 -1
- package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +29 -52
- package/esm/storages/inLocalStorage/index.js +7 -3
- package/esm/storages/inMemory/InMemoryStorageCS.js +5 -0
- package/esm/storages/inMemory/MySegmentsCacheInMemory.js +9 -40
- package/esm/storages/inMemory/SplitsCacheInMemory.js +8 -8
- package/esm/storages/inMemory/TelemetryCacheInMemory.js +7 -10
- package/esm/storages/pluggable/inMemoryWrapper.js +1 -1
- package/esm/sync/polling/fetchers/mySegmentsFetcher.js +5 -8
- package/esm/sync/polling/fetchers/segmentChangesFetcher.js +1 -1
- package/esm/sync/polling/pollingManagerCS.js +1 -1
- package/esm/sync/polling/syncTasks/mySegmentsSyncTask.js +2 -2
- package/esm/sync/polling/updaters/mySegmentsUpdater.js +15 -21
- package/esm/sync/streaming/AuthClient/index.js +1 -1
- package/esm/sync/streaming/SSEHandler/index.js +4 -6
- package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +108 -49
- package/esm/sync/streaming/constants.js +2 -2
- package/esm/sync/streaming/parseUtils.js +12 -8
- package/esm/sync/streaming/pushManager.js +72 -70
- package/esm/utils/constants/index.js +3 -2
- package/esm/utils/settingsValidation/index.js +2 -1
- package/package.json +1 -1
- package/src/dtos/types.ts +21 -7
- package/src/evaluator/matchers/index.ts +2 -0
- package/src/evaluator/matchers/large_segment.ts +18 -0
- package/src/evaluator/matchers/matcherTypes.ts +1 -0
- package/src/evaluator/matchersTransform/index.ts +4 -1
- package/src/evaluator/matchersTransform/segment.ts +5 -3
- package/src/logger/constants.ts +1 -1
- package/src/logger/messages/info.ts +1 -1
- package/src/logger/messages/warn.ts +1 -1
- package/src/readiness/readinessManager.ts +7 -5
- package/src/readiness/sdkReadinessManager.ts +7 -7
- package/src/readiness/types.ts +2 -2
- package/src/sdkClient/sdkClientMethodCS.ts +2 -2
- package/src/sdkClient/sdkClientMethodCSWithTT.ts +2 -2
- package/src/sdkFactory/index.ts +1 -1
- package/src/services/splitApi.ts +7 -7
- package/src/services/splitHttpClient.ts +1 -1
- package/src/services/types.ts +2 -2
- package/src/storages/AbstractSegmentsCacheSync.ts +53 -12
- package/src/storages/AbstractSplitsCacheSync.ts +4 -3
- package/src/storages/KeyBuilderCS.ts +34 -5
- package/src/storages/dataLoader.ts +1 -1
- package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +29 -59
- package/src/storages/inLocalStorage/index.ts +8 -4
- package/src/storages/inMemory/InMemoryStorageCS.ts +5 -0
- package/src/storages/inMemory/MySegmentsCacheInMemory.ts +10 -44
- package/src/storages/inMemory/SplitsCacheInMemory.ts +7 -8
- package/src/storages/inMemory/TelemetryCacheInMemory.ts +7 -11
- package/src/storages/pluggable/inMemoryWrapper.ts +1 -1
- package/src/storages/types.ts +11 -7
- package/src/sync/polling/fetchers/mySegmentsFetcher.ts +8 -10
- package/src/sync/polling/fetchers/segmentChangesFetcher.ts +1 -1
- package/src/sync/polling/fetchers/types.ts +3 -2
- package/src/sync/polling/pollingManagerCS.ts +4 -4
- package/src/sync/polling/syncTasks/mySegmentsSyncTask.ts +4 -5
- package/src/sync/polling/types.ts +7 -6
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +19 -22
- package/src/sync/streaming/AuthClient/index.ts +1 -1
- package/src/sync/streaming/SSEClient/index.ts +4 -6
- package/src/sync/streaming/SSEHandler/index.ts +5 -8
- package/src/sync/streaming/SSEHandler/types.ts +15 -15
- package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +116 -49
- package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +1 -1
- package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +1 -1
- package/src/sync/streaming/UpdateWorkers/types.ts +2 -2
- package/src/sync/streaming/constants.ts +2 -2
- package/src/sync/streaming/parseUtils.ts +19 -11
- package/src/sync/streaming/pushManager.ts +73 -72
- package/src/sync/streaming/types.ts +10 -10
- package/src/sync/submitters/types.ts +8 -5
- package/src/utils/constants/index.ts +3 -2
- package/src/utils/settingsValidation/index.ts +3 -2
- package/src/utils/settingsValidation/types.ts +1 -1
- package/types/dtos/types.d.ts +18 -7
- package/types/evaluator/matchersTransform/segment.d.ts +2 -2
- package/types/logger/constants.d.ts +1 -1
- package/types/readiness/readinessManager.d.ts +2 -2
- package/types/readiness/sdkReadinessManager.d.ts +2 -3
- package/types/readiness/types.d.ts +2 -2
- package/types/services/splitApi.d.ts +1 -1
- package/types/services/splitHttpClient.d.ts +1 -1
- package/types/services/types.d.ts +2 -2
- package/types/storages/AbstractSegmentsCacheSync.d.ts +9 -11
- package/types/storages/AbstractSplitsCacheSync.d.ts +1 -1
- package/types/storages/KeyBuilderCS.d.ts +9 -2
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +4 -14
- package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +3 -9
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +1 -1
- package/types/storages/inMemory/TelemetryCacheInMemory.d.ts +4 -6
- package/types/storages/pluggable/inMemoryWrapper.d.ts +1 -1
- package/types/storages/types.d.ts +7 -5
- package/types/sync/polling/fetchers/mySegmentsFetcher.d.ts +2 -2
- package/types/sync/polling/fetchers/types.d.ts +2 -2
- package/types/sync/polling/syncTasks/mySegmentsSyncTask.d.ts +2 -2
- package/types/sync/polling/types.d.ts +7 -4
- package/types/sync/polling/updaters/mySegmentsUpdater.d.ts +4 -3
- package/types/sync/streaming/SSEHandler/types.d.ts +16 -14
- package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +4 -2
- package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +2 -1
- package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +3 -2
- package/types/sync/streaming/UpdateWorkers/types.d.ts +2 -2
- package/types/sync/streaming/constants.d.ts +2 -2
- package/types/sync/streaming/parseUtils.d.ts +4 -5
- package/types/sync/streaming/types.d.ts +8 -8
- package/types/sync/submitters/types.d.ts +7 -4
- package/types/utils/constants/index.d.ts +3 -2
- package/types/utils/settingsValidation/types.d.ts +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
|
+
import { isNaNNumber } from '../../utils/lang';
|
|
2
3
|
import { AbstractSegmentsCacheSync } from '../AbstractSegmentsCacheSync';
|
|
3
4
|
import { LOG_PREFIX, DEFINED } from './constants';
|
|
4
5
|
var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
@@ -10,19 +11,11 @@ var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
|
10
11
|
return _this;
|
|
11
12
|
// There is not need to flush segments cache like splits cache, since resetSegments receives the up-to-date list of active segments
|
|
12
13
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Removes list of segments from localStorage
|
|
15
|
-
* @NOTE this method is not being used at the moment.
|
|
16
|
-
*/
|
|
17
|
-
MySegmentsCacheInLocal.prototype.clear = function () {
|
|
18
|
-
this.log.info(LOG_PREFIX + 'Flushing MySegments data from localStorage');
|
|
19
|
-
// We cannot simply call `localStorage.clear()` since that implies removing user items from the storage
|
|
20
|
-
// We could optimize next sentence, since it implies iterating over all localStorage items
|
|
21
|
-
this.resetSegments([]);
|
|
22
|
-
};
|
|
23
14
|
MySegmentsCacheInLocal.prototype.addToSegment = function (name) {
|
|
24
15
|
var segmentKey = this.keys.buildSegmentNameKey(name);
|
|
25
16
|
try {
|
|
17
|
+
if (localStorage.getItem(segmentKey) === DEFINED)
|
|
18
|
+
return false;
|
|
26
19
|
localStorage.setItem(segmentKey, DEFINED);
|
|
27
20
|
return true;
|
|
28
21
|
}
|
|
@@ -34,6 +27,8 @@ var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
|
34
27
|
MySegmentsCacheInLocal.prototype.removeFromSegment = function (name) {
|
|
35
28
|
var segmentKey = this.keys.buildSegmentNameKey(name);
|
|
36
29
|
try {
|
|
30
|
+
if (localStorage.getItem(segmentKey) !== DEFINED)
|
|
31
|
+
return false;
|
|
37
32
|
localStorage.removeItem(segmentKey);
|
|
38
33
|
return true;
|
|
39
34
|
}
|
|
@@ -45,30 +40,22 @@ var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
|
45
40
|
MySegmentsCacheInLocal.prototype.isInSegment = function (name) {
|
|
46
41
|
return localStorage.getItem(this.keys.buildSegmentNameKey(name)) === DEFINED;
|
|
47
42
|
};
|
|
48
|
-
|
|
49
|
-
* Reset (update) the cached list of segments with the given list, removing and adding segments if necessary.
|
|
50
|
-
*
|
|
51
|
-
* @param {string[]} segmentNames list of segment names
|
|
52
|
-
* @returns boolean indicating if the cache was updated (i.e., given list was different from the cached one)
|
|
53
|
-
*/
|
|
54
|
-
MySegmentsCacheInLocal.prototype.resetSegments = function (names) {
|
|
43
|
+
MySegmentsCacheInLocal.prototype.getRegisteredSegments = function () {
|
|
55
44
|
var _this = this;
|
|
56
|
-
var isDiff = false;
|
|
57
|
-
var index;
|
|
58
45
|
// Scan current values from localStorage
|
|
59
|
-
|
|
46
|
+
return Object.keys(localStorage).reduce(function (accum, key) {
|
|
60
47
|
var segmentName = _this.keys.extractSegmentName(key);
|
|
61
48
|
if (segmentName) {
|
|
62
49
|
accum.push(segmentName);
|
|
63
50
|
}
|
|
64
51
|
else {
|
|
65
|
-
// @TODO @BREAKING: This is only to clean up "old" keys. Remove this whole else code block
|
|
52
|
+
// @TODO @BREAKING: This is only to clean up "old" keys. Remove this whole else code block
|
|
66
53
|
segmentName = _this.keys.extractOldSegmentKey(key);
|
|
67
54
|
if (segmentName) { // this was an old segment key, let's clean up.
|
|
68
55
|
var newSegmentKey = _this.keys.buildSegmentNameKey(segmentName);
|
|
69
56
|
try {
|
|
70
57
|
// If the new format key is not there, create it.
|
|
71
|
-
if (!localStorage.getItem(newSegmentKey)
|
|
58
|
+
if (!localStorage.getItem(newSegmentKey)) {
|
|
72
59
|
localStorage.setItem(newSegmentKey, DEFINED);
|
|
73
60
|
// we are migrating a segment, let's track it.
|
|
74
61
|
accum.push(segmentName);
|
|
@@ -82,40 +69,30 @@ var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
|
82
69
|
}
|
|
83
70
|
return accum;
|
|
84
71
|
}, []);
|
|
85
|
-
// Extreme fast => everything is empty
|
|
86
|
-
if (names.length === 0 && storedSegmentNames.length === names.length)
|
|
87
|
-
return isDiff;
|
|
88
|
-
// Quick path
|
|
89
|
-
if (storedSegmentNames.length !== names.length) {
|
|
90
|
-
isDiff = true;
|
|
91
|
-
storedSegmentNames.forEach(function (name) { return _this.removeFromSegment(name); });
|
|
92
|
-
names.forEach(function (name) { return _this.addToSegment(name); });
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
// Slowest path => we need to find at least 1 difference because
|
|
96
|
-
for (index = 0; index < names.length && storedSegmentNames.indexOf(names[index]) !== -1; index++) {
|
|
97
|
-
// TODO: why empty statement?
|
|
98
|
-
}
|
|
99
|
-
if (index < names.length) {
|
|
100
|
-
isDiff = true;
|
|
101
|
-
storedSegmentNames.forEach(function (name) { return _this.removeFromSegment(name); });
|
|
102
|
-
names.forEach(function (name) { return _this.addToSegment(name); });
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return isDiff;
|
|
106
|
-
};
|
|
107
|
-
MySegmentsCacheInLocal.prototype.getRegisteredSegments = function () {
|
|
108
|
-
var _this = this;
|
|
109
|
-
return Object.keys(localStorage).reduce(function (accum, key) {
|
|
110
|
-
var segmentName = _this.keys.extractSegmentName(key);
|
|
111
|
-
if (segmentName)
|
|
112
|
-
accum.push(segmentName);
|
|
113
|
-
return accum;
|
|
114
|
-
}, []);
|
|
115
72
|
};
|
|
116
73
|
MySegmentsCacheInLocal.prototype.getKeysCount = function () {
|
|
117
74
|
return 1;
|
|
118
75
|
};
|
|
76
|
+
MySegmentsCacheInLocal.prototype.setChangeNumber = function (name, changeNumber) {
|
|
77
|
+
try {
|
|
78
|
+
if (changeNumber)
|
|
79
|
+
localStorage.setItem(this.keys.buildTillKey(), changeNumber + '');
|
|
80
|
+
else
|
|
81
|
+
localStorage.removeItem(this.keys.buildTillKey());
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
this.log.error(e);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
MySegmentsCacheInLocal.prototype.getChangeNumber = function () {
|
|
88
|
+
var n = -1;
|
|
89
|
+
var value = localStorage.getItem(this.keys.buildTillKey());
|
|
90
|
+
if (value !== null) {
|
|
91
|
+
value = parseInt(value, 10);
|
|
92
|
+
return isNaNNumber(value) ? n : value;
|
|
93
|
+
}
|
|
94
|
+
return n;
|
|
95
|
+
};
|
|
119
96
|
return MySegmentsCacheInLocal;
|
|
120
97
|
}(AbstractSegmentsCacheSync));
|
|
121
98
|
export { MySegmentsCacheInLocal };
|
|
@@ -2,7 +2,7 @@ import { ImpressionsCacheInMemory } from '../inMemory/ImpressionsCacheInMemory';
|
|
|
2
2
|
import { ImpressionCountsCacheInMemory } from '../inMemory/ImpressionCountsCacheInMemory';
|
|
3
3
|
import { EventsCacheInMemory } from '../inMemory/EventsCacheInMemory';
|
|
4
4
|
import { validatePrefix } from '../KeyBuilder';
|
|
5
|
-
import { KeyBuilderCS } from '../KeyBuilderCS';
|
|
5
|
+
import { KeyBuilderCS, myLargeSegmentsKeyBuilder } from '../KeyBuilderCS';
|
|
6
6
|
import { isLocalStorageAvailable } from '../../utils/env/isLocalStorageAvailable';
|
|
7
7
|
import { SplitsCacheInLocal } from './SplitsCacheInLocal';
|
|
8
8
|
import { MySegmentsCacheInLocal } from './MySegmentsCacheInLocal';
|
|
@@ -33,9 +33,11 @@ export function InLocalStorage(options) {
|
|
|
33
33
|
var expirationTimestamp = Date.now() - DEFAULT_CACHE_EXPIRATION_IN_MILLIS;
|
|
34
34
|
var splits = new SplitsCacheInLocal(settings, keys, expirationTimestamp);
|
|
35
35
|
var segments = new MySegmentsCacheInLocal(log, keys);
|
|
36
|
+
var largeSegments = new MySegmentsCacheInLocal(log, myLargeSegmentsKeyBuilder(prefix, matchingKey));
|
|
36
37
|
return {
|
|
37
38
|
splits: splits,
|
|
38
39
|
segments: segments,
|
|
40
|
+
largeSegments: largeSegments,
|
|
39
41
|
impressions: new ImpressionsCacheInMemory(impressionsQueueSize),
|
|
40
42
|
impressionCounts: impressionsMode !== DEBUG ? new ImpressionCountsCacheInMemory() : undefined,
|
|
41
43
|
events: new EventsCacheInMemory(eventsQueueSize),
|
|
@@ -45,6 +47,7 @@ export function InLocalStorage(options) {
|
|
|
45
47
|
var _a;
|
|
46
48
|
this.splits = new SplitsCacheInMemory(__splitFiltersValidation);
|
|
47
49
|
this.segments = new MySegmentsCacheInMemory();
|
|
50
|
+
this.largeSegments = new MySegmentsCacheInMemory();
|
|
48
51
|
this.impressions.clear();
|
|
49
52
|
this.impressionCounts && this.impressionCounts.clear();
|
|
50
53
|
this.events.clear();
|
|
@@ -52,10 +55,10 @@ export function InLocalStorage(options) {
|
|
|
52
55
|
},
|
|
53
56
|
// When using shared instanciation with MEMORY we reuse everything but segments (they are customer per key).
|
|
54
57
|
shared: function (matchingKey) {
|
|
55
|
-
var childKeysBuilder = new KeyBuilderCS(prefix, matchingKey);
|
|
56
58
|
return {
|
|
57
59
|
splits: this.splits,
|
|
58
|
-
segments: new MySegmentsCacheInLocal(log,
|
|
60
|
+
segments: new MySegmentsCacheInLocal(log, new KeyBuilderCS(prefix, matchingKey)),
|
|
61
|
+
largeSegments: new MySegmentsCacheInLocal(log, myLargeSegmentsKeyBuilder(prefix, matchingKey)),
|
|
59
62
|
impressions: this.impressions,
|
|
60
63
|
impressionCounts: this.impressionCounts,
|
|
61
64
|
events: this.events,
|
|
@@ -63,6 +66,7 @@ export function InLocalStorage(options) {
|
|
|
63
66
|
destroy: function () {
|
|
64
67
|
this.splits = new SplitsCacheInMemory(__splitFiltersValidation);
|
|
65
68
|
this.segments = new MySegmentsCacheInMemory();
|
|
69
|
+
this.largeSegments = new MySegmentsCacheInMemory();
|
|
66
70
|
}
|
|
67
71
|
};
|
|
68
72
|
},
|
|
@@ -15,9 +15,11 @@ export function InMemoryStorageCSFactory(params) {
|
|
|
15
15
|
var _a = params.settings, _b = _a.scheduler, impressionsQueueSize = _b.impressionsQueueSize, eventsQueueSize = _b.eventsQueueSize, _c = _a.sync, impressionsMode = _c.impressionsMode, __splitFiltersValidation = _c.__splitFiltersValidation;
|
|
16
16
|
var splits = new SplitsCacheInMemory(__splitFiltersValidation);
|
|
17
17
|
var segments = new MySegmentsCacheInMemory();
|
|
18
|
+
var largeSegments = new MySegmentsCacheInMemory();
|
|
18
19
|
var storage = {
|
|
19
20
|
splits: splits,
|
|
20
21
|
segments: segments,
|
|
22
|
+
largeSegments: largeSegments,
|
|
21
23
|
impressions: new ImpressionsCacheInMemory(impressionsQueueSize),
|
|
22
24
|
impressionCounts: impressionsMode !== DEBUG ? new ImpressionCountsCacheInMemory() : undefined,
|
|
23
25
|
events: new EventsCacheInMemory(eventsQueueSize),
|
|
@@ -27,6 +29,7 @@ export function InMemoryStorageCSFactory(params) {
|
|
|
27
29
|
destroy: function () {
|
|
28
30
|
this.splits.clear();
|
|
29
31
|
this.segments.clear();
|
|
32
|
+
this.largeSegments.clear();
|
|
30
33
|
this.impressions.clear();
|
|
31
34
|
this.impressionCounts && this.impressionCounts.clear();
|
|
32
35
|
this.events.clear();
|
|
@@ -37,6 +40,7 @@ export function InMemoryStorageCSFactory(params) {
|
|
|
37
40
|
return {
|
|
38
41
|
splits: this.splits,
|
|
39
42
|
segments: new MySegmentsCacheInMemory(),
|
|
43
|
+
largeSegments: new MySegmentsCacheInMemory(),
|
|
40
44
|
impressions: this.impressions,
|
|
41
45
|
impressionCounts: this.impressionCounts,
|
|
42
46
|
events: this.events,
|
|
@@ -45,6 +49,7 @@ export function InMemoryStorageCSFactory(params) {
|
|
|
45
49
|
destroy: function () {
|
|
46
50
|
this.splits = new SplitsCacheInMemory(__splitFiltersValidation);
|
|
47
51
|
this.segments.clear();
|
|
52
|
+
this.largeSegments.clear();
|
|
48
53
|
}
|
|
49
54
|
};
|
|
50
55
|
},
|
|
@@ -11,57 +11,26 @@ var MySegmentsCacheInMemory = /** @class */ (function (_super) {
|
|
|
11
11
|
_this.segmentCache = {};
|
|
12
12
|
return _this;
|
|
13
13
|
}
|
|
14
|
-
MySegmentsCacheInMemory.prototype.clear = function () {
|
|
15
|
-
this.segmentCache = {};
|
|
16
|
-
};
|
|
17
14
|
MySegmentsCacheInMemory.prototype.addToSegment = function (name) {
|
|
15
|
+
if (this.segmentCache[name])
|
|
16
|
+
return false;
|
|
18
17
|
this.segmentCache[name] = true;
|
|
19
18
|
return true;
|
|
20
19
|
};
|
|
21
20
|
MySegmentsCacheInMemory.prototype.removeFromSegment = function (name) {
|
|
21
|
+
if (!this.segmentCache[name])
|
|
22
|
+
return false;
|
|
22
23
|
delete this.segmentCache[name];
|
|
23
24
|
return true;
|
|
24
25
|
};
|
|
25
26
|
MySegmentsCacheInMemory.prototype.isInSegment = function (name) {
|
|
26
27
|
return this.segmentCache[name] === true;
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* @returns boolean indicating if the cache was updated (i.e., given list was different from the cached one)
|
|
34
|
-
*/
|
|
35
|
-
MySegmentsCacheInMemory.prototype.resetSegments = function (names) {
|
|
36
|
-
var _this = this;
|
|
37
|
-
var isDiff = false;
|
|
38
|
-
var index;
|
|
39
|
-
var storedSegmentKeys = Object.keys(this.segmentCache);
|
|
40
|
-
// Extreme fast => everything is empty
|
|
41
|
-
if (names.length === 0 && storedSegmentKeys.length === names.length)
|
|
42
|
-
return isDiff;
|
|
43
|
-
// Quick path
|
|
44
|
-
if (storedSegmentKeys.length !== names.length) {
|
|
45
|
-
isDiff = true;
|
|
46
|
-
this.segmentCache = {};
|
|
47
|
-
names.forEach(function (s) {
|
|
48
|
-
_this.addToSegment(s);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
// Slowest path => we need to find at least 1 difference because
|
|
53
|
-
for (index = 0; index < names.length && this.isInSegment(names[index]); index++) {
|
|
54
|
-
// TODO: why empty statement?
|
|
55
|
-
}
|
|
56
|
-
if (index < names.length) {
|
|
57
|
-
isDiff = true;
|
|
58
|
-
this.segmentCache = {};
|
|
59
|
-
names.forEach(function (s) {
|
|
60
|
-
_this.addToSegment(s);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return isDiff;
|
|
29
|
+
MySegmentsCacheInMemory.prototype.setChangeNumber = function (name, changeNumber) {
|
|
30
|
+
this.cn = changeNumber;
|
|
31
|
+
};
|
|
32
|
+
MySegmentsCacheInMemory.prototype.getChangeNumber = function () {
|
|
33
|
+
return this.cn || -1;
|
|
65
34
|
};
|
|
66
35
|
MySegmentsCacheInMemory.prototype.getRegisteredSegments = function () {
|
|
67
36
|
return Object.keys(this.segmentCache);
|
|
@@ -13,7 +13,7 @@ var SplitsCacheInMemory = /** @class */ (function (_super) {
|
|
|
13
13
|
_this.splitsCache = {};
|
|
14
14
|
_this.ttCache = {};
|
|
15
15
|
_this.changeNumber = -1;
|
|
16
|
-
_this.
|
|
16
|
+
_this.segmentsCount = 0;
|
|
17
17
|
_this.flagSetsCache = {};
|
|
18
18
|
_this.flagSetsFilter = splitFiltersValidation ? splitFiltersValidation.groupedFilters.bySet : [];
|
|
19
19
|
return _this;
|
|
@@ -22,7 +22,7 @@ var SplitsCacheInMemory = /** @class */ (function (_super) {
|
|
|
22
22
|
this.splitsCache = {};
|
|
23
23
|
this.ttCache = {};
|
|
24
24
|
this.changeNumber = -1;
|
|
25
|
-
this.
|
|
25
|
+
this.segmentsCount = 0;
|
|
26
26
|
};
|
|
27
27
|
SplitsCacheInMemory.prototype.addSplit = function (name, split) {
|
|
28
28
|
var previousSplit = this.getSplit(name);
|
|
@@ -32,9 +32,9 @@ var SplitsCacheInMemory = /** @class */ (function (_super) {
|
|
|
32
32
|
if (!this.ttCache[previousTtName])
|
|
33
33
|
delete this.ttCache[previousTtName];
|
|
34
34
|
this.removeFromFlagSets(previousSplit.name, previousSplit.sets);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// Subtract from segments count for the previous version of this Split
|
|
36
|
+
if (usesSegments(previousSplit))
|
|
37
|
+
this.segmentsCount--;
|
|
38
38
|
}
|
|
39
39
|
if (split) {
|
|
40
40
|
// Store the Split.
|
|
@@ -45,7 +45,7 @@ var SplitsCacheInMemory = /** @class */ (function (_super) {
|
|
|
45
45
|
this.addToFlagSets(split);
|
|
46
46
|
// Add to segments count for the new version of the Split
|
|
47
47
|
if (usesSegments(split))
|
|
48
|
-
this.
|
|
48
|
+
this.segmentsCount++;
|
|
49
49
|
return true;
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
@@ -64,7 +64,7 @@ var SplitsCacheInMemory = /** @class */ (function (_super) {
|
|
|
64
64
|
this.removeFromFlagSets(split.name, split.sets);
|
|
65
65
|
// Update the segments count.
|
|
66
66
|
if (usesSegments(split))
|
|
67
|
-
this.
|
|
67
|
+
this.segmentsCount--;
|
|
68
68
|
return true;
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
@@ -88,7 +88,7 @@ var SplitsCacheInMemory = /** @class */ (function (_super) {
|
|
|
88
88
|
return isFiniteNumber(this.ttCache[trafficType]) && this.ttCache[trafficType] > 0;
|
|
89
89
|
};
|
|
90
90
|
SplitsCacheInMemory.prototype.usesSegments = function () {
|
|
91
|
-
return this.getChangeNumber() === -1 || this.
|
|
91
|
+
return this.getChangeNumber() === -1 || this.segmentsCount > 0;
|
|
92
92
|
};
|
|
93
93
|
SplitsCacheInMemory.prototype.getNamesByFlagSets = function (flagSets) {
|
|
94
94
|
var _this = this;
|
|
@@ -18,9 +18,10 @@ export function shouldRecordTelemetry(_a) {
|
|
|
18
18
|
return settings.mode !== LOCALHOST_MODE && (settings.core.key === undefined || Math.random() <= ACCEPTANCE_RANGE);
|
|
19
19
|
}
|
|
20
20
|
var TelemetryCacheInMemory = /** @class */ (function () {
|
|
21
|
-
function TelemetryCacheInMemory(splits, segments) {
|
|
21
|
+
function TelemetryCacheInMemory(splits, segments, largeSegments) {
|
|
22
22
|
this.splits = splits;
|
|
23
23
|
this.segments = segments;
|
|
24
|
+
this.largeSegments = largeSegments;
|
|
24
25
|
// isEmpty flag
|
|
25
26
|
this.e = true;
|
|
26
27
|
this.notReadyUsage = 0;
|
|
@@ -36,10 +37,7 @@ var TelemetryCacheInMemory = /** @class */ (function () {
|
|
|
36
37
|
this.tags = [];
|
|
37
38
|
this.exceptions = {};
|
|
38
39
|
this.latencies = {};
|
|
39
|
-
this.updatesFromSSE = {
|
|
40
|
-
sp: 0,
|
|
41
|
-
ms: 0
|
|
42
|
-
};
|
|
40
|
+
this.updatesFromSSE = {};
|
|
43
41
|
}
|
|
44
42
|
TelemetryCacheInMemory.prototype.isEmpty = function () { return this.e; };
|
|
45
43
|
TelemetryCacheInMemory.prototype.clear = function () { };
|
|
@@ -59,6 +57,8 @@ var TelemetryCacheInMemory = /** @class */ (function () {
|
|
|
59
57
|
spC: this.splits && this.splits.getSplitNames().length,
|
|
60
58
|
seC: this.segments && this.segments.getRegisteredSegments().length,
|
|
61
59
|
skC: this.segments && this.segments.getKeysCount(),
|
|
60
|
+
lsC: this.largeSegments && this.largeSegments.getRegisteredSegments().length,
|
|
61
|
+
lskC: this.largeSegments && this.largeSegments.getKeysCount(),
|
|
62
62
|
sL: this.getSessionLength(),
|
|
63
63
|
eQ: this.getEventStats(QUEUED),
|
|
64
64
|
eD: this.getEventStats(DROPPED),
|
|
@@ -190,14 +190,11 @@ var TelemetryCacheInMemory = /** @class */ (function () {
|
|
|
190
190
|
};
|
|
191
191
|
TelemetryCacheInMemory.prototype.popUpdatesFromSSE = function () {
|
|
192
192
|
var result = this.updatesFromSSE;
|
|
193
|
-
this.updatesFromSSE = {
|
|
194
|
-
sp: 0,
|
|
195
|
-
ms: 0,
|
|
196
|
-
};
|
|
193
|
+
this.updatesFromSSE = {};
|
|
197
194
|
return result;
|
|
198
195
|
};
|
|
199
196
|
TelemetryCacheInMemory.prototype.recordUpdatesFromSSE = function (type) {
|
|
200
|
-
this.updatesFromSSE[type]
|
|
197
|
+
this.updatesFromSSE[type] = (this.updatesFromSSE[type] || 0) + 1;
|
|
201
198
|
this.e = false;
|
|
202
199
|
};
|
|
203
200
|
return TelemetryCacheInMemory;
|
|
@@ -5,7 +5,7 @@ import { setToArray, _Set } from '../../utils/lang/sets';
|
|
|
5
5
|
* The `_cache` property is the object were items are stored.
|
|
6
6
|
* Intended for testing purposes.
|
|
7
7
|
*
|
|
8
|
-
* @param connDelay delay in millis for `connect` resolve. If not provided, `connect` resolves
|
|
8
|
+
* @param connDelay delay in millis for `connect` resolve. If not provided, `connect` resolves immediately.
|
|
9
9
|
*/
|
|
10
10
|
export function inMemoryWrapperFactory(connDelay) {
|
|
11
11
|
var _cache = {};
|
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
* Factory of MySegments fetcher.
|
|
3
3
|
* MySegments fetcher is a wrapper around `mySegments` API service that parses the response and handle errors.
|
|
4
4
|
*/
|
|
5
|
-
export function mySegmentsFetcherFactory(
|
|
6
|
-
return function mySegmentsFetcher(userMatchingKey, noCache,
|
|
7
|
-
// Optional decorator for `
|
|
5
|
+
export function mySegmentsFetcherFactory(fetchMemberships) {
|
|
6
|
+
return function mySegmentsFetcher(userMatchingKey, noCache, till,
|
|
7
|
+
// Optional decorator for `fetchMemberships` promise, such as timeout or time tracker
|
|
8
8
|
decorator) {
|
|
9
|
-
var mySegmentsPromise =
|
|
9
|
+
var mySegmentsPromise = fetchMemberships(userMatchingKey, noCache, till);
|
|
10
10
|
if (decorator)
|
|
11
11
|
mySegmentsPromise = decorator(mySegmentsPromise);
|
|
12
|
-
|
|
13
|
-
return mySegmentsPromise
|
|
14
|
-
.then(function (resp) { return resp.json(); })
|
|
15
|
-
.then(function (json) { return json.mySegments.map(function (segment) { return segment.name; }); });
|
|
12
|
+
return mySegmentsPromise.then(function (resp) { return resp.json(); });
|
|
16
13
|
};
|
|
17
14
|
}
|
|
@@ -20,7 +20,7 @@ function greedyFetch(fetchSegmentChanges, since, segmentName, noCache, targetTil
|
|
|
20
20
|
*/
|
|
21
21
|
export function segmentChangesFetcherFactory(fetchSegmentChanges) {
|
|
22
22
|
return function segmentChangesFetcher(since, segmentName, noCache, till,
|
|
23
|
-
// Optional decorator for `
|
|
23
|
+
// Optional decorator for `fetchSegmentChanges` promise, such as timeout or time tracker
|
|
24
24
|
decorator) {
|
|
25
25
|
var segmentsPromise = greedyFetch(fetchSegmentChanges, since, segmentName, noCache, till);
|
|
26
26
|
if (decorator)
|
|
@@ -43,7 +43,7 @@ export function pollingManagerCSFactory(params) {
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
function add(matchingKey, readiness, storage) {
|
|
46
|
-
var mySegmentsSyncTask = mySegmentsSyncTaskFactory(splitApi.
|
|
46
|
+
var mySegmentsSyncTask = mySegmentsSyncTaskFactory(splitApi.fetchMemberships, storage, readiness, settings, matchingKey);
|
|
47
47
|
// smart ready
|
|
48
48
|
function smartReady() {
|
|
49
49
|
if (!readiness.isReady() && !storage.splits.usesSegments())
|
|
@@ -4,6 +4,6 @@ import { mySegmentsUpdaterFactory } from '../updaters/mySegmentsUpdater';
|
|
|
4
4
|
/**
|
|
5
5
|
* Creates a sync task that periodically executes a `mySegmentsUpdater` task
|
|
6
6
|
*/
|
|
7
|
-
export function mySegmentsSyncTaskFactory(
|
|
8
|
-
return syncTaskFactory(settings.log, mySegmentsUpdaterFactory(settings.log, mySegmentsFetcherFactory(
|
|
7
|
+
export function mySegmentsSyncTaskFactory(fetchMemberships, storage, readiness, settings, matchingKey) {
|
|
8
|
+
return syncTaskFactory(settings.log, mySegmentsUpdaterFactory(settings.log, mySegmentsFetcherFactory(fetchMemberships), storage, readiness.segments, settings.startup.requestTimeoutBeforeReady, settings.startup.retriesOnFailureBeforeReady, matchingKey), settings.scheduler.segmentsRefreshRate, 'mySegmentsUpdater');
|
|
9
9
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { timeout } from '../../../utils/promise/timeout';
|
|
2
2
|
import { SDK_SEGMENTS_ARRIVED } from '../../../readiness/constants';
|
|
3
3
|
import { SYNC_MYSEGMENTS_FETCH_RETRY } from '../../../logger/constants';
|
|
4
|
+
import { MEMBERSHIPS_LS_UPDATE } from '../../streaming/constants';
|
|
4
5
|
/**
|
|
5
6
|
* factory of MySegments updater, a task that:
|
|
6
7
|
* - fetches mySegments using `mySegmentsFetcher`
|
|
7
8
|
* - updates `mySegmentsCache`
|
|
8
9
|
* - uses `segmentsEventEmitter` to emit events related to segments data updates
|
|
9
10
|
*/
|
|
10
|
-
export function mySegmentsUpdaterFactory(log, mySegmentsFetcher,
|
|
11
|
+
export function mySegmentsUpdaterFactory(log, mySegmentsFetcher, storage, segmentsEventEmitter, requestTimeoutBeforeReady, retriesOnFailureBeforeReady, matchingKey) {
|
|
12
|
+
var splits = storage.splits, segments = storage.segments, largeSegments = storage.largeSegments;
|
|
11
13
|
var readyOnAlreadyExistentState = true;
|
|
12
14
|
var startingUp = true;
|
|
13
15
|
/** timeout and telemetry decorator for `splitChangesFetcher` promise */
|
|
@@ -19,36 +21,27 @@ export function mySegmentsUpdaterFactory(log, mySegmentsFetcher, splitsCache, my
|
|
|
19
21
|
// @TODO if allowing pluggable storages, handle async execution
|
|
20
22
|
function updateSegments(segmentsData) {
|
|
21
23
|
var shouldNotifyUpdate;
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
if (segmentsData.type !== undefined) {
|
|
25
|
+
shouldNotifyUpdate = segmentsData.type === MEMBERSHIPS_LS_UPDATE ?
|
|
26
|
+
largeSegments.resetSegments(segmentsData) :
|
|
27
|
+
segments.resetSegments(segmentsData);
|
|
25
28
|
}
|
|
26
29
|
else {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (mySegmentsCache.isInSegment(name_1) !== add) {
|
|
30
|
-
shouldNotifyUpdate = true;
|
|
31
|
-
if (add)
|
|
32
|
-
mySegmentsCache.addToSegment(name_1);
|
|
33
|
-
else
|
|
34
|
-
mySegmentsCache.removeFromSegment(name_1);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
shouldNotifyUpdate = false;
|
|
38
|
-
}
|
|
30
|
+
shouldNotifyUpdate = segments.resetSegments(segmentsData.ms || {});
|
|
31
|
+
shouldNotifyUpdate = largeSegments.resetSegments(segmentsData.ls || {}) || shouldNotifyUpdate;
|
|
39
32
|
}
|
|
40
33
|
// Notify update if required
|
|
41
|
-
if (
|
|
34
|
+
if (splits.usesSegments() && (shouldNotifyUpdate || readyOnAlreadyExistentState)) {
|
|
42
35
|
readyOnAlreadyExistentState = false;
|
|
43
36
|
segmentsEventEmitter.emit(SDK_SEGMENTS_ARRIVED);
|
|
44
37
|
}
|
|
45
38
|
}
|
|
46
|
-
function _mySegmentsUpdater(retry, segmentsData, noCache) {
|
|
39
|
+
function _mySegmentsUpdater(retry, segmentsData, noCache, till) {
|
|
47
40
|
var updaterPromise = segmentsData ?
|
|
48
41
|
// If segmentsData is provided, there is no need to fetch mySegments
|
|
49
42
|
new Promise(function (res) { updateSegments(segmentsData); res(true); }) :
|
|
50
43
|
// If not provided, fetch mySegments
|
|
51
|
-
mySegmentsFetcher(matchingKey, noCache, _promiseDecorator).then(function (segments) {
|
|
44
|
+
mySegmentsFetcher(matchingKey, noCache, till, _promiseDecorator).then(function (segments) {
|
|
52
45
|
// Only when we have downloaded segments completely, we should not keep retrying anymore
|
|
53
46
|
startingUp = false;
|
|
54
47
|
updateSegments(segments);
|
|
@@ -75,8 +68,9 @@ export function mySegmentsUpdaterFactory(log, mySegmentsFetcher, splitsCache, my
|
|
|
75
68
|
* (2) an object with a segment name and action (true: add, or false: delete) to update the storage,
|
|
76
69
|
* (3) or `undefined`, for which the updater will fetch mySegments in order to sync the storage.
|
|
77
70
|
* @param {boolean | undefined} noCache true to revalidate data to fetch
|
|
71
|
+
* @param {boolean | undefined} till query param to bypass CDN requests
|
|
78
72
|
*/
|
|
79
|
-
return function mySegmentsUpdater(segmentsData, noCache) {
|
|
80
|
-
return _mySegmentsUpdater(0, segmentsData, noCache);
|
|
73
|
+
return function mySegmentsUpdater(segmentsData, noCache, till) {
|
|
74
|
+
return _mySegmentsUpdater(0, segmentsData, noCache, till);
|
|
81
75
|
};
|
|
82
76
|
}
|
|
@@ -10,7 +10,7 @@ import { hash } from '../../../utils/murmur3/murmur3';
|
|
|
10
10
|
export function authenticateFactory(fetchAuth) {
|
|
11
11
|
/**
|
|
12
12
|
* Run authentication requests to Auth Server, and returns a promise that resolves with the decoded JTW token.
|
|
13
|
-
* @param {string[] | undefined} userKeys set of user Keys to track
|
|
13
|
+
* @param {string[] | undefined} userKeys set of user Keys to track membership updates. It is undefined for server-side API.
|
|
14
14
|
*/
|
|
15
15
|
return function authenticate(userKeys) {
|
|
16
16
|
return fetchAuth(userKeys)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { errorParser, messageParser } from './NotificationParser';
|
|
2
2
|
import { notificationKeeperFactory } from './NotificationKeeper';
|
|
3
|
-
import { PUSH_RETRYABLE_ERROR, PUSH_NONRETRYABLE_ERROR, OCCUPANCY, CONTROL,
|
|
3
|
+
import { PUSH_RETRYABLE_ERROR, PUSH_NONRETRYABLE_ERROR, OCCUPANCY, CONTROL, SEGMENT_UPDATE, SPLIT_KILL, SPLIT_UPDATE, MEMBERSHIPS_MS_UPDATE, MEMBERSHIPS_LS_UPDATE } from '../constants';
|
|
4
4
|
import { STREAMING_PARSING_ERROR_FAILS, ERROR_STREAMING_SSE, STREAMING_PARSING_MESSAGE_FAILS, STREAMING_NEW_MESSAGE } from '../../../logger/constants';
|
|
5
5
|
import { ABLY_ERROR, NON_REQUESTED, SSE_CONNECTION_ERROR } from '../../../utils/constants';
|
|
6
6
|
/**
|
|
@@ -65,20 +65,18 @@ export function SSEHandlerFactory(log, pushEmitter, telemetryTracker) {
|
|
|
65
65
|
}
|
|
66
66
|
var parsedData = messageWithParsedData.parsedData, data = messageWithParsedData.data, channel = messageWithParsedData.channel, timestamp = messageWithParsedData.timestamp;
|
|
67
67
|
log.debug(STREAMING_NEW_MESSAGE, [data]);
|
|
68
|
-
// we only handle update events if streaming is up
|
|
68
|
+
// we only handle update events if streaming is up
|
|
69
69
|
if (!notificationKeeper.isStreamingUp() && [OCCUPANCY, CONTROL].indexOf(parsedData.type) === -1)
|
|
70
70
|
return;
|
|
71
71
|
switch (parsedData.type) {
|
|
72
72
|
/* update events */
|
|
73
73
|
case SPLIT_UPDATE:
|
|
74
74
|
case SEGMENT_UPDATE:
|
|
75
|
-
case
|
|
75
|
+
case MEMBERSHIPS_MS_UPDATE:
|
|
76
|
+
case MEMBERSHIPS_LS_UPDATE:
|
|
76
77
|
case SPLIT_KILL:
|
|
77
78
|
pushEmitter.emit(parsedData.type, parsedData);
|
|
78
79
|
break;
|
|
79
|
-
case MY_SEGMENTS_UPDATE:
|
|
80
|
-
pushEmitter.emit(parsedData.type, parsedData, channel);
|
|
81
|
-
break;
|
|
82
80
|
/* occupancy & control events, handled by NotificationManagerKeeper */
|
|
83
81
|
case OCCUPANCY:
|
|
84
82
|
notificationKeeper.handleOccupancyEvent(parsedData.metrics.publishers, channel, timestamp);
|