@splitsoftware/splitio-commons 1.17.1-rc.2 → 1.17.1-rc.4
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 +4 -3
- package/cjs/readiness/readinessManager.js +13 -2
- package/cjs/sdkClient/sdkClientMethodCS.js +0 -1
- package/cjs/sdkClient/sdkClientMethodCSWithTT.js +0 -1
- package/cjs/sdkFactory/index.js +27 -11
- package/cjs/storages/{AbstractSegmentsCacheSync.js → AbstractMySegmentsCacheSync.js} +15 -17
- package/cjs/storages/AbstractSplitsCacheAsync.js +7 -0
- package/cjs/storages/AbstractSplitsCacheSync.js +7 -0
- package/cjs/storages/dataLoader.js +32 -65
- package/cjs/storages/inLocalStorage/MySegmentsCacheInLocal.js +5 -5
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +9 -1
- package/cjs/storages/inLocalStorage/index.js +1 -4
- package/cjs/storages/inMemory/InMemoryStorageCS.js +5 -17
- package/cjs/storages/inMemory/MySegmentsCacheInMemory.js +5 -5
- package/cjs/storages/inMemory/SegmentsCacheInMemory.js +13 -27
- package/cjs/storages/inMemory/SplitsCacheInMemory.js +0 -1
- package/cjs/storages/inRedis/SegmentsCacheInRedis.js +13 -19
- package/cjs/storages/pluggable/SegmentsCachePluggable.js +11 -32
- package/cjs/sync/offline/syncManagerOffline.js +18 -11
- package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +7 -2
- package/cjs/sync/polling/pollingManagerSS.js +3 -3
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +12 -28
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +10 -1
- package/cjs/sync/syncManagerOnline.js +20 -21
- package/cjs/trackers/eventTracker.js +12 -10
- package/cjs/trackers/impressionsTracker.js +16 -14
- package/cjs/trackers/uniqueKeysTracker.js +5 -3
- package/cjs/utils/settingsValidation/storage/storageCS.js +12 -1
- package/esm/readiness/readinessManager.js +13 -2
- package/esm/sdkClient/sdkClientMethodCS.js +0 -1
- package/esm/sdkClient/sdkClientMethodCSWithTT.js +0 -1
- package/esm/sdkFactory/index.js +28 -12
- package/esm/storages/{AbstractSegmentsCacheSync.js → AbstractMySegmentsCacheSync.js} +14 -16
- package/esm/storages/AbstractSplitsCacheAsync.js +7 -0
- package/esm/storages/AbstractSplitsCacheSync.js +7 -0
- package/esm/storages/dataLoader.js +30 -62
- package/esm/storages/inLocalStorage/MySegmentsCacheInLocal.js +5 -5
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +9 -1
- package/esm/storages/inLocalStorage/index.js +2 -5
- package/esm/storages/inMemory/InMemoryStorageCS.js +5 -17
- package/esm/storages/inMemory/MySegmentsCacheInMemory.js +5 -5
- package/esm/storages/inMemory/SegmentsCacheInMemory.js +13 -27
- package/esm/storages/inMemory/SplitsCacheInMemory.js +0 -1
- package/esm/storages/inRedis/SegmentsCacheInRedis.js +13 -19
- package/esm/storages/pluggable/SegmentsCachePluggable.js +11 -32
- package/esm/sync/offline/syncManagerOffline.js +18 -11
- package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +8 -3
- package/esm/sync/polling/pollingManagerSS.js +3 -3
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +12 -28
- package/esm/sync/polling/updaters/splitChangesUpdater.js +11 -2
- package/esm/sync/syncManagerOnline.js +20 -21
- package/esm/trackers/eventTracker.js +12 -10
- package/esm/trackers/impressionsTracker.js +16 -14
- package/esm/trackers/uniqueKeysTracker.js +5 -3
- package/esm/utils/settingsValidation/storage/storageCS.js +10 -0
- package/package.json +1 -1
- package/src/readiness/readinessManager.ts +12 -3
- package/src/readiness/types.ts +3 -0
- package/src/sdkClient/sdkClientMethodCS.ts +0 -2
- package/src/sdkClient/sdkClientMethodCSWithTT.ts +0 -2
- package/src/sdkFactory/index.ts +30 -14
- package/src/sdkFactory/types.ts +2 -0
- package/src/storages/{AbstractSegmentsCacheSync.ts → AbstractMySegmentsCacheSync.ts} +13 -28
- package/src/storages/AbstractSplitsCacheAsync.ts +8 -0
- package/src/storages/AbstractSplitsCacheSync.ts +8 -0
- package/src/storages/dataLoader.ts +32 -63
- package/src/storages/inLocalStorage/MySegmentsCacheInLocal.ts +5 -5
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +10 -1
- package/src/storages/inLocalStorage/index.ts +2 -6
- package/src/storages/inMemory/InMemoryStorageCS.ts +5 -20
- package/src/storages/inMemory/MySegmentsCacheInMemory.ts +5 -5
- package/src/storages/inMemory/SegmentsCacheInMemory.ts +12 -26
- package/src/storages/inMemory/SplitsCacheInMemory.ts +0 -1
- package/src/storages/inRedis/SegmentsCacheInRedis.ts +13 -22
- package/src/storages/pluggable/SegmentsCachePluggable.ts +11 -35
- package/src/storages/types.ts +9 -10
- package/src/sync/offline/syncManagerOffline.ts +21 -13
- package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +7 -3
- package/src/sync/polling/pollingManagerSS.ts +2 -3
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +13 -29
- package/src/sync/polling/updaters/splitChangesUpdater.ts +11 -3
- package/src/sync/syncManagerOnline.ts +17 -17
- package/src/sync/types.ts +1 -1
- package/src/trackers/eventTracker.ts +11 -8
- package/src/trackers/impressionsTracker.ts +13 -10
- package/src/trackers/types.ts +1 -0
- package/src/trackers/uniqueKeysTracker.ts +6 -4
- package/src/types.ts +8 -9
- package/src/utils/settingsValidation/storage/storageCS.ts +13 -0
- package/types/readiness/types.d.ts +3 -0
- package/types/sdkFactory/types.d.ts +1 -0
- package/types/storages/AbstractSplitsCacheAsync.d.ts +5 -0
- package/types/storages/AbstractSplitsCacheSync.d.ts +5 -0
- package/types/storages/dataLoader.d.ts +6 -17
- package/types/storages/inLocalStorage/MySegmentsCacheInLocal.d.ts +5 -5
- package/types/storages/inLocalStorage/SplitsCacheInLocal.d.ts +6 -0
- package/types/storages/inMemory/MySegmentsCacheInMemory.d.ts +5 -5
- package/types/storages/inMemory/SegmentsCacheInMemory.d.ts +5 -7
- package/types/storages/inMemory/SplitsCacheInMemory.d.ts +0 -1
- package/types/storages/inRedis/SegmentsCacheInRedis.d.ts +6 -3
- package/types/storages/pluggable/SegmentsCachePluggable.d.ts +4 -16
- package/types/storages/types.d.ts +7 -10
- package/types/sync/types.d.ts +1 -1
- package/types/trackers/eventTracker.d.ts +1 -1
- package/types/trackers/impressionsTracker.d.ts +1 -1
- package/types/trackers/types.d.ts +1 -0
- package/types/types.d.ts +8 -8
- package/types/utils/settingsValidation/storage/storageCS.d.ts +5 -0
|
@@ -2,35 +2,33 @@
|
|
|
2
2
|
* This class provides a skeletal implementation of the ISegmentsCacheSync interface
|
|
3
3
|
* to minimize the effort required to implement this interface.
|
|
4
4
|
*/
|
|
5
|
-
var
|
|
6
|
-
function
|
|
5
|
+
var AbstractMySegmentsCacheSync = /** @class */ (function () {
|
|
6
|
+
function AbstractMySegmentsCacheSync() {
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* clear the cache.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
AbstractMySegmentsCacheSync.prototype.clear = function () {
|
|
12
12
|
this.resetSegments({});
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
AbstractSegmentsCacheSync.prototype.registerSegments = function (names) { return false; };
|
|
14
|
+
// No-op. Not used in client-side.
|
|
15
|
+
AbstractMySegmentsCacheSync.prototype.registerSegments = function () { return false; };
|
|
16
|
+
AbstractMySegmentsCacheSync.prototype.update = function () { return false; };
|
|
19
17
|
/**
|
|
20
18
|
* For server-side synchronizer: the method is not used.
|
|
21
19
|
* For client-side synchronizer: it resets or updates the cache.
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
AbstractMySegmentsCacheSync.prototype.resetSegments = function (segmentsData) {
|
|
24
22
|
var _this = this;
|
|
25
|
-
this.setChangeNumber(
|
|
23
|
+
this.setChangeNumber(segmentsData.cn);
|
|
26
24
|
var _a = segmentsData, added = _a.added, removed = _a.removed;
|
|
27
25
|
if (added && removed) {
|
|
28
26
|
var isDiff_1 = false;
|
|
29
27
|
added.forEach(function (segment) {
|
|
30
|
-
isDiff_1 = _this.
|
|
28
|
+
isDiff_1 = _this.addSegment(segment) || isDiff_1;
|
|
31
29
|
});
|
|
32
30
|
removed.forEach(function (segment) {
|
|
33
|
-
isDiff_1 = _this.
|
|
31
|
+
isDiff_1 = _this.removeSegment(segment) || isDiff_1;
|
|
34
32
|
});
|
|
35
33
|
return isDiff_1;
|
|
36
34
|
}
|
|
@@ -47,13 +45,13 @@ var AbstractSegmentsCacheSync = /** @class */ (function () {
|
|
|
47
45
|
return false;
|
|
48
46
|
// Slowest path => add and/or remove segments
|
|
49
47
|
for (var removeIndex = index; removeIndex < storedSegmentKeys.length; removeIndex++) {
|
|
50
|
-
this.
|
|
48
|
+
this.removeSegment(storedSegmentKeys[removeIndex]);
|
|
51
49
|
}
|
|
52
50
|
for (var addIndex = index; addIndex < names.length; addIndex++) {
|
|
53
|
-
this.
|
|
51
|
+
this.addSegment(names[addIndex]);
|
|
54
52
|
}
|
|
55
53
|
return true;
|
|
56
54
|
};
|
|
57
|
-
return
|
|
55
|
+
return AbstractMySegmentsCacheSync;
|
|
58
56
|
}());
|
|
59
|
-
export {
|
|
57
|
+
export { AbstractMySegmentsCacheSync };
|
|
@@ -11,6 +11,13 @@ var AbstractSplitsCacheAsync = /** @class */ (function () {
|
|
|
11
11
|
AbstractSplitsCacheAsync.prototype.usesSegments = function () {
|
|
12
12
|
return Promise.resolve(true);
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Check if the splits information is already stored in cache.
|
|
16
|
+
* Noop, just keeping the interface. This is used by client-side implementations only.
|
|
17
|
+
*/
|
|
18
|
+
AbstractSplitsCacheAsync.prototype.checkCache = function () {
|
|
19
|
+
return Promise.resolve(false);
|
|
20
|
+
};
|
|
14
21
|
/**
|
|
15
22
|
* Kill `name` split and set `defaultTreatment` and `changeNumber`.
|
|
16
23
|
* Used for SPLIT_KILL push notifications.
|
|
@@ -27,6 +27,13 @@ var AbstractSplitsCacheSync = /** @class */ (function () {
|
|
|
27
27
|
var _this = this;
|
|
28
28
|
return this.getSplitNames().map(function (key) { return _this.getSplit(key); });
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if the splits information is already stored in cache. This data can be preloaded.
|
|
32
|
+
* It is used as condition to emit SDK_SPLITS_CACHE_LOADED, and then SDK_READY_FROM_CACHE.
|
|
33
|
+
*/
|
|
34
|
+
AbstractSplitsCacheSync.prototype.checkCache = function () {
|
|
35
|
+
return false;
|
|
36
|
+
};
|
|
30
37
|
/**
|
|
31
38
|
* Kill `name` split and set `defaultTreatment` and `changeNumber`.
|
|
32
39
|
* Used for SPLIT_KILL push notifications.
|
|
@@ -1,79 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_CACHE_EXPIRATION_IN_MILLIS } from '../utils/constants/browser';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* (https://github.com/godaddy/split-javascript-data-loader/blob/master/src/load-data.js)
|
|
3
|
+
* Factory of client-side storage loader
|
|
5
4
|
*
|
|
6
|
-
* @param preloadedData validated data following the format proposed in https://github.com/godaddy/split-javascript-data-loader
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
9
|
-
*
|
|
10
|
-
* @TODO extend to load largeSegments
|
|
11
|
-
* @TODO extend to load data on shared mySegments storages. Be specific when emitting SDK_READY_FROM_CACHE on shared clients. Maybe the serializer should provide the `useSegments` flag.
|
|
12
|
-
* @TODO add logs, and input validation in this module, in favor of size reduction.
|
|
13
|
-
* @TODO unit tests
|
|
5
|
+
* @param preloadedData validated data following the format proposed in https://github.com/godaddy/split-javascript-data-loader
|
|
6
|
+
* and extended with a `mySegmentsData` property.
|
|
7
|
+
* @returns function to preload the storage
|
|
14
8
|
*/
|
|
15
|
-
export function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
export function dataLoaderFactory(preloadedData) {
|
|
10
|
+
/**
|
|
11
|
+
* Storage-agnostic adaptation of `loadDataIntoLocalStorage` function
|
|
12
|
+
* (https://github.com/godaddy/split-javascript-data-loader/blob/master/src/load-data.js)
|
|
13
|
+
*
|
|
14
|
+
* @param storage object containing `splits` and `segments` cache (client-side variant)
|
|
15
|
+
* @param userId user key string of the provided MySegmentsCache
|
|
16
|
+
*
|
|
17
|
+
* @TODO extend to support SegmentsCache (server-side variant) by making `userId` optional and adding the corresponding logic.
|
|
18
|
+
* @TODO extend to load data on shared mySegments storages. Be specific when emitting SDK_READY_FROM_CACHE on shared clients. Maybe the serializer should provide the `useSegments` flag.
|
|
19
|
+
*/
|
|
20
|
+
return function loadData(storage, userId) {
|
|
21
|
+
// Do not load data if current preloadedData is empty
|
|
22
|
+
if (Object.keys(preloadedData).length === 0)
|
|
23
|
+
return;
|
|
24
|
+
var _a = preloadedData.lastUpdated, lastUpdated = _a === void 0 ? -1 : _a, _b = preloadedData.segmentsData, segmentsData = _b === void 0 ? {} : _b, _c = preloadedData.since, since = _c === void 0 ? -1 : _c, _d = preloadedData.splitsData, splitsData = _d === void 0 ? {} : _d;
|
|
21
25
|
var storedSince = storage.splits.getChangeNumber();
|
|
22
|
-
|
|
23
|
-
if
|
|
26
|
+
var expirationTimestamp = Date.now() - DEFAULT_CACHE_EXPIRATION_IN_MILLIS;
|
|
27
|
+
// Do not load data if current localStorage data is more recent,
|
|
28
|
+
// or if its `lastUpdated` timestamp is older than the given `expirationTimestamp`,
|
|
29
|
+
if (storedSince > since || lastUpdated < expirationTimestamp)
|
|
24
30
|
return;
|
|
25
31
|
// cleaning up the localStorage data, since some cached splits might need be part of the preloaded data
|
|
26
32
|
storage.splits.clear();
|
|
27
33
|
storage.splits.setChangeNumber(since);
|
|
28
34
|
// splitsData in an object where the property is the split name and the pertaining value is a stringified json of its data
|
|
29
|
-
storage.splits.addSplits(splitsData.map(function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var mySegmentsData = preloadedData.mySegmentsData && preloadedData.mySegmentsData[userKey];
|
|
35
|
+
storage.splits.addSplits(Object.keys(splitsData).map(function (splitName) { return JSON.parse(splitsData[splitName]); }));
|
|
36
|
+
// add mySegments data
|
|
37
|
+
var mySegmentsData = preloadedData.mySegmentsData && preloadedData.mySegmentsData[userId];
|
|
33
38
|
if (!mySegmentsData) {
|
|
34
39
|
// segmentsData in an object where the property is the segment name and the pertaining value is a stringified object that contains the `added` array of userIds
|
|
35
40
|
mySegmentsData = Object.keys(segmentsData).filter(function (segmentName) {
|
|
36
|
-
var
|
|
37
|
-
return
|
|
41
|
+
var userIds = JSON.parse(segmentsData[segmentName]).added;
|
|
42
|
+
return Array.isArray(userIds) && userIds.indexOf(userId) > -1;
|
|
38
43
|
});
|
|
39
44
|
}
|
|
40
45
|
storage.segments.resetSegments({ k: mySegmentsData.map(function (s) { return ({ n: s }); }) });
|
|
41
|
-
}
|
|
42
|
-
else { // add segments data (server-side)
|
|
43
|
-
Object.keys(segmentsData).filter(function (segmentName) {
|
|
44
|
-
var userKeys = segmentsData[segmentName];
|
|
45
|
-
storage.segments.addToSegment(segmentName, userKeys);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export function getSnapshot(storage, userKeys) {
|
|
50
|
-
return {
|
|
51
|
-
// lastUpdated: Date.now(),
|
|
52
|
-
// @ts-ignore accessing private prop
|
|
53
|
-
since: storage.splits.changeNumber,
|
|
54
|
-
splitsData: storage.splits.getAll(),
|
|
55
|
-
segmentsData: userKeys ?
|
|
56
|
-
undefined : // @ts-ignore accessing private prop
|
|
57
|
-
Object.keys(storage.segments.segmentCache).reduce(function (prev, cur) {
|
|
58
|
-
prev[cur] = setToArray(storage.segments.segmentCache[cur]);
|
|
59
|
-
return prev;
|
|
60
|
-
}, {}),
|
|
61
|
-
mySegmentsData: userKeys ?
|
|
62
|
-
userKeys.reduce(function (prev, userKey) {
|
|
63
|
-
// @ts-ignore accessing private prop
|
|
64
|
-
prev[userKey] = storage.shared ?
|
|
65
|
-
// Client-side segments
|
|
66
|
-
// @ts-ignore accessing private prop
|
|
67
|
-
Object.keys(storage.shared(userKey).segments.segmentCache) :
|
|
68
|
-
// Server-side segments
|
|
69
|
-
// @ts-ignore accessing private prop
|
|
70
|
-
Object.keys(storage.segments.segmentCache).reduce(function (prev, segmentName) {
|
|
71
|
-
return storage.segments.segmentCache[segmentName].has(userKey) ?
|
|
72
|
-
prev.concat(segmentName) :
|
|
73
|
-
prev;
|
|
74
|
-
}, []);
|
|
75
|
-
return prev;
|
|
76
|
-
}, {}) :
|
|
77
|
-
undefined
|
|
78
46
|
};
|
|
79
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
2
|
import { isNaNNumber } from '../../utils/lang';
|
|
3
|
-
import {
|
|
3
|
+
import { AbstractMySegmentsCacheSync } from '../AbstractMySegmentsCacheSync';
|
|
4
4
|
import { LOG_PREFIX, DEFINED } from './constants';
|
|
5
5
|
var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
6
6
|
__extends(MySegmentsCacheInLocal, _super);
|
|
@@ -11,7 +11,7 @@ var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
|
11
11
|
return _this;
|
|
12
12
|
// There is not need to flush segments cache like splits cache, since resetSegments receives the up-to-date list of active segments
|
|
13
13
|
}
|
|
14
|
-
MySegmentsCacheInLocal.prototype.
|
|
14
|
+
MySegmentsCacheInLocal.prototype.addSegment = function (name) {
|
|
15
15
|
var segmentKey = this.keys.buildSegmentNameKey(name);
|
|
16
16
|
try {
|
|
17
17
|
if (localStorage.getItem(segmentKey) === DEFINED)
|
|
@@ -24,7 +24,7 @@ var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
MySegmentsCacheInLocal.prototype.
|
|
27
|
+
MySegmentsCacheInLocal.prototype.removeSegment = function (name) {
|
|
28
28
|
var segmentKey = this.keys.buildSegmentNameKey(name);
|
|
29
29
|
try {
|
|
30
30
|
if (localStorage.getItem(segmentKey) !== DEFINED)
|
|
@@ -73,7 +73,7 @@ var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
|
73
73
|
MySegmentsCacheInLocal.prototype.getKeysCount = function () {
|
|
74
74
|
return 1;
|
|
75
75
|
};
|
|
76
|
-
MySegmentsCacheInLocal.prototype.setChangeNumber = function (
|
|
76
|
+
MySegmentsCacheInLocal.prototype.setChangeNumber = function (changeNumber) {
|
|
77
77
|
try {
|
|
78
78
|
if (changeNumber)
|
|
79
79
|
localStorage.setItem(this.keys.buildTillKey(), changeNumber + '');
|
|
@@ -94,5 +94,5 @@ var MySegmentsCacheInLocal = /** @class */ (function (_super) {
|
|
|
94
94
|
return n;
|
|
95
95
|
};
|
|
96
96
|
return MySegmentsCacheInLocal;
|
|
97
|
-
}(
|
|
97
|
+
}(AbstractMySegmentsCacheSync));
|
|
98
98
|
export { MySegmentsCacheInLocal };
|
|
@@ -183,6 +183,14 @@ var SplitsCacheInLocal = /** @class */ (function (_super) {
|
|
|
183
183
|
return true;
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
|
+
/**
|
|
187
|
+
* Check if the splits information is already stored in browser LocalStorage.
|
|
188
|
+
* In this function we could add more code to check if the data is valid.
|
|
189
|
+
* @override
|
|
190
|
+
*/
|
|
191
|
+
SplitsCacheInLocal.prototype.checkCache = function () {
|
|
192
|
+
return this.getChangeNumber() > -1;
|
|
193
|
+
};
|
|
186
194
|
/**
|
|
187
195
|
* Clean Splits cache if its `lastUpdated` timestamp is older than the given `expirationTimestamp`,
|
|
188
196
|
*
|
|
@@ -205,7 +213,7 @@ var SplitsCacheInLocal = /** @class */ (function (_super) {
|
|
|
205
213
|
// mark cache to update the new query filter on first successful splits fetch
|
|
206
214
|
this.updateNewFilter = true;
|
|
207
215
|
// if there is cache, clear it
|
|
208
|
-
if (this.
|
|
216
|
+
if (this.checkCache())
|
|
209
217
|
this.clear();
|
|
210
218
|
}
|
|
211
219
|
catch (e) {
|
|
@@ -11,7 +11,7 @@ import { SplitsCacheInMemory } from '../inMemory/SplitsCacheInMemory';
|
|
|
11
11
|
import { DEFAULT_CACHE_EXPIRATION_IN_MILLIS } from '../../utils/constants/browser';
|
|
12
12
|
import { InMemoryStorageCSFactory } from '../inMemory/InMemoryStorageCS';
|
|
13
13
|
import { LOG_PREFIX } from './constants';
|
|
14
|
-
import { DEBUG,
|
|
14
|
+
import { DEBUG, NONE, STORAGE_LOCALSTORAGE } from '../../utils/constants';
|
|
15
15
|
import { shouldRecordTelemetry, TelemetryCacheInMemory } from '../inMemory/TelemetryCacheInMemory';
|
|
16
16
|
import { UniqueKeysCacheInMemoryCS } from '../inMemory/UniqueKeysCacheInMemoryCS';
|
|
17
17
|
import { getMatching } from '../../utils/key';
|
|
@@ -27,16 +27,13 @@ export function InLocalStorage(options) {
|
|
|
27
27
|
params.settings.log.warn(LOG_PREFIX + 'LocalStorage API is unavailable. Falling back to default MEMORY storage');
|
|
28
28
|
return InMemoryStorageCSFactory(params);
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var settings = params.settings, _a = params.settings, log = _a.log, _b = _a.scheduler, impressionsQueueSize = _b.impressionsQueueSize, eventsQueueSize = _b.eventsQueueSize, _c = _a.sync, impressionsMode = _c.impressionsMode, __splitFiltersValidation = _c.__splitFiltersValidation;
|
|
31
31
|
var matchingKey = getMatching(settings.core.key);
|
|
32
32
|
var keys = new KeyBuilderCS(prefix, matchingKey);
|
|
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
36
|
var largeSegments = new MySegmentsCacheInLocal(log, myLargeSegmentsKeyBuilder(prefix, matchingKey));
|
|
37
|
-
if (settings.mode === LOCALHOST_MODE || splits.getChangeNumber() > -1) {
|
|
38
|
-
Promise.resolve().then(onReadyFromCacheCb);
|
|
39
|
-
}
|
|
40
37
|
return {
|
|
41
38
|
splits: splits,
|
|
42
39
|
segments: segments,
|
|
@@ -6,15 +6,13 @@ import { ImpressionCountsCacheInMemory } from './ImpressionCountsCacheInMemory';
|
|
|
6
6
|
import { DEBUG, LOCALHOST_MODE, NONE, STORAGE_MEMORY } from '../../utils/constants';
|
|
7
7
|
import { shouldRecordTelemetry, TelemetryCacheInMemory } from './TelemetryCacheInMemory';
|
|
8
8
|
import { UniqueKeysCacheInMemoryCS } from './UniqueKeysCacheInMemoryCS';
|
|
9
|
-
import { getMatching } from '../../utils/key';
|
|
10
|
-
import { loadData } from '../dataLoader';
|
|
11
9
|
/**
|
|
12
10
|
* InMemory storage factory for standalone client-side SplitFactory
|
|
13
11
|
*
|
|
14
12
|
* @param params parameters required by EventsCacheSync
|
|
15
13
|
*/
|
|
16
14
|
export function InMemoryStorageCSFactory(params) {
|
|
17
|
-
var _a = params.settings, _b = _a.scheduler, impressionsQueueSize = _b.impressionsQueueSize, eventsQueueSize = _b.eventsQueueSize, _c = _a.sync, impressionsMode = _c.impressionsMode, __splitFiltersValidation = _c.__splitFiltersValidation
|
|
15
|
+
var _a = params.settings, _b = _a.scheduler, impressionsQueueSize = _b.impressionsQueueSize, eventsQueueSize = _b.eventsQueueSize, _c = _a.sync, impressionsMode = _c.impressionsMode, __splitFiltersValidation = _c.__splitFiltersValidation;
|
|
18
16
|
var splits = new SplitsCacheInMemory(__splitFiltersValidation);
|
|
19
17
|
var segments = new MySegmentsCacheInMemory();
|
|
20
18
|
var largeSegments = new MySegmentsCacheInMemory();
|
|
@@ -38,16 +36,11 @@ export function InMemoryStorageCSFactory(params) {
|
|
|
38
36
|
this.uniqueKeys && this.uniqueKeys.clear();
|
|
39
37
|
},
|
|
40
38
|
// When using shared instanciation with MEMORY we reuse everything but segments (they are unique per key)
|
|
41
|
-
shared: function (
|
|
42
|
-
var segments = new MySegmentsCacheInMemory();
|
|
43
|
-
var largeSegments = new MySegmentsCacheInMemory();
|
|
44
|
-
if (preloadedData) {
|
|
45
|
-
loadData(preloadedData, { segments: segments, largeSegments: largeSegments }, matchingKey);
|
|
46
|
-
}
|
|
39
|
+
shared: function () {
|
|
47
40
|
return {
|
|
48
41
|
splits: this.splits,
|
|
49
|
-
segments:
|
|
50
|
-
largeSegments:
|
|
42
|
+
segments: new MySegmentsCacheInMemory(),
|
|
43
|
+
largeSegments: new MySegmentsCacheInMemory(),
|
|
51
44
|
impressions: this.impressions,
|
|
52
45
|
impressionCounts: this.impressionCounts,
|
|
53
46
|
events: this.events,
|
|
@@ -62,7 +55,7 @@ export function InMemoryStorageCSFactory(params) {
|
|
|
62
55
|
},
|
|
63
56
|
};
|
|
64
57
|
// @TODO revisit storage logic in localhost mode
|
|
65
|
-
// No tracking
|
|
58
|
+
// No tracking in localhost mode to avoid memory leaks: https://github.com/splitio/javascript-commons/issues/181
|
|
66
59
|
if (params.settings.mode === LOCALHOST_MODE) {
|
|
67
60
|
var noopTrack = function () { return true; };
|
|
68
61
|
storage.impressions.track = noopTrack;
|
|
@@ -72,11 +65,6 @@ export function InMemoryStorageCSFactory(params) {
|
|
|
72
65
|
if (storage.uniqueKeys)
|
|
73
66
|
storage.uniqueKeys.track = noopTrack;
|
|
74
67
|
}
|
|
75
|
-
if (preloadedData) {
|
|
76
|
-
loadData(preloadedData, storage, getMatching(params.settings.core.key));
|
|
77
|
-
if (splits.getChangeNumber() > -1)
|
|
78
|
-
onReadyFromCacheCb();
|
|
79
|
-
}
|
|
80
68
|
return storage;
|
|
81
69
|
}
|
|
82
70
|
InMemoryStorageCSFactory.type = STORAGE_MEMORY;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { AbstractMySegmentsCacheSync } from '../AbstractMySegmentsCacheSync';
|
|
3
3
|
/**
|
|
4
4
|
* Default MySegmentsCacheInMemory implementation that stores MySegments in memory.
|
|
5
5
|
* Supported by all JS runtimes.
|
|
@@ -11,13 +11,13 @@ var MySegmentsCacheInMemory = /** @class */ (function (_super) {
|
|
|
11
11
|
_this.segmentCache = {};
|
|
12
12
|
return _this;
|
|
13
13
|
}
|
|
14
|
-
MySegmentsCacheInMemory.prototype.
|
|
14
|
+
MySegmentsCacheInMemory.prototype.addSegment = function (name) {
|
|
15
15
|
if (this.segmentCache[name])
|
|
16
16
|
return false;
|
|
17
17
|
this.segmentCache[name] = true;
|
|
18
18
|
return true;
|
|
19
19
|
};
|
|
20
|
-
MySegmentsCacheInMemory.prototype.
|
|
20
|
+
MySegmentsCacheInMemory.prototype.removeSegment = function (name) {
|
|
21
21
|
if (!this.segmentCache[name])
|
|
22
22
|
return false;
|
|
23
23
|
delete this.segmentCache[name];
|
|
@@ -26,7 +26,7 @@ var MySegmentsCacheInMemory = /** @class */ (function (_super) {
|
|
|
26
26
|
MySegmentsCacheInMemory.prototype.isInSegment = function (name) {
|
|
27
27
|
return this.segmentCache[name] === true;
|
|
28
28
|
};
|
|
29
|
-
MySegmentsCacheInMemory.prototype.setChangeNumber = function (
|
|
29
|
+
MySegmentsCacheInMemory.prototype.setChangeNumber = function (changeNumber) {
|
|
30
30
|
this.cn = changeNumber;
|
|
31
31
|
};
|
|
32
32
|
MySegmentsCacheInMemory.prototype.getChangeNumber = function () {
|
|
@@ -39,5 +39,5 @@ var MySegmentsCacheInMemory = /** @class */ (function (_super) {
|
|
|
39
39
|
return 1;
|
|
40
40
|
};
|
|
41
41
|
return MySegmentsCacheInMemory;
|
|
42
|
-
}(
|
|
42
|
+
}(AbstractMySegmentsCacheSync));
|
|
43
43
|
export { MySegmentsCacheInMemory };
|
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
import { __extends } from "tslib";
|
|
2
|
-
import { AbstractSegmentsCacheSync } from '../AbstractSegmentsCacheSync';
|
|
3
1
|
import { _Set } from '../../utils/lang/sets';
|
|
4
2
|
import { isIntegerNumber } from '../../utils/lang';
|
|
5
3
|
/**
|
|
6
|
-
* Default ISplitsCacheSync implementation that stores
|
|
7
|
-
* Supported by all JS runtimes.
|
|
4
|
+
* Default ISplitsCacheSync implementation for server-side that stores segments definitions in memory.
|
|
8
5
|
*/
|
|
9
|
-
var SegmentsCacheInMemory = /** @class */ (function (
|
|
10
|
-
__extends(SegmentsCacheInMemory, _super);
|
|
6
|
+
var SegmentsCacheInMemory = /** @class */ (function () {
|
|
11
7
|
function SegmentsCacheInMemory() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
_this.segmentChangeNumber = {};
|
|
15
|
-
return _this;
|
|
8
|
+
this.segmentCache = {};
|
|
9
|
+
this.segmentChangeNumber = {};
|
|
16
10
|
}
|
|
17
|
-
SegmentsCacheInMemory.prototype.
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.segmentCache[name] = keySet;
|
|
22
|
-
return true;
|
|
23
|
-
};
|
|
24
|
-
SegmentsCacheInMemory.prototype.removeFromSegment = function (name, segmentKeys) {
|
|
25
|
-
var values = this.segmentCache[name];
|
|
26
|
-
var keySet = values ? values : new _Set();
|
|
27
|
-
segmentKeys.forEach(function (k) { return keySet.delete(k); });
|
|
11
|
+
SegmentsCacheInMemory.prototype.update = function (name, addedKeys, removedKeys, changeNumber) {
|
|
12
|
+
var keySet = this.segmentCache[name] || new _Set();
|
|
13
|
+
addedKeys.forEach(function (k) { return keySet.add(k); });
|
|
14
|
+
removedKeys.forEach(function (k) { return keySet.delete(k); });
|
|
28
15
|
this.segmentCache[name] = keySet;
|
|
29
|
-
|
|
16
|
+
this.segmentChangeNumber[name] = changeNumber;
|
|
17
|
+
return addedKeys.length > 0 || removedKeys.length > 0;
|
|
30
18
|
};
|
|
31
19
|
SegmentsCacheInMemory.prototype.isInSegment = function (name, key) {
|
|
32
20
|
var segmentValues = this.segmentCache[name];
|
|
@@ -60,14 +48,12 @@ var SegmentsCacheInMemory = /** @class */ (function (_super) {
|
|
|
60
48
|
return acum + _this.segmentCache[segmentName].size;
|
|
61
49
|
}, 0);
|
|
62
50
|
};
|
|
63
|
-
SegmentsCacheInMemory.prototype.setChangeNumber = function (name, changeNumber) {
|
|
64
|
-
this.segmentChangeNumber[name] = changeNumber;
|
|
65
|
-
return true;
|
|
66
|
-
};
|
|
67
51
|
SegmentsCacheInMemory.prototype.getChangeNumber = function (name) {
|
|
68
52
|
var value = this.segmentChangeNumber[name];
|
|
69
53
|
return isIntegerNumber(value) ? value : -1;
|
|
70
54
|
};
|
|
55
|
+
// No-op. Not used in server-side
|
|
56
|
+
SegmentsCacheInMemory.prototype.resetSegments = function () { return false; };
|
|
71
57
|
return SegmentsCacheInMemory;
|
|
72
|
-
}(
|
|
58
|
+
}());
|
|
73
59
|
export { SegmentsCacheInMemory };
|
|
@@ -4,7 +4,6 @@ import { isFiniteNumber } from '../../utils/lang';
|
|
|
4
4
|
import { _Set } from '../../utils/lang/sets';
|
|
5
5
|
/**
|
|
6
6
|
* Default ISplitsCacheSync implementation that stores split definitions in memory.
|
|
7
|
-
* Supported by all JS runtimes.
|
|
8
7
|
*/
|
|
9
8
|
var SplitsCacheInMemory = /** @class */ (function (_super) {
|
|
10
9
|
__extends(SplitsCacheInMemory, _super);
|
|
@@ -6,30 +6,24 @@ var SegmentsCacheInRedis = /** @class */ (function () {
|
|
|
6
6
|
this.redis = redis;
|
|
7
7
|
this.keys = keys;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Update the given segment `name` with the lists of `addedKeys`, `removedKeys` and `changeNumber`.
|
|
11
|
+
* The returned promise is resolved if the operation success, with `true` if the segment was updated (i.e., some key was added or removed),
|
|
12
|
+
* or rejected if it fails (e.g., Redis operation fails).
|
|
13
|
+
*/
|
|
14
|
+
SegmentsCacheInRedis.prototype.update = function (name, addedKeys, removedKeys, changeNumber) {
|
|
10
15
|
var segmentKey = this.keys.buildSegmentNameKey(name);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
SegmentsCacheInRedis.prototype.removeFromSegment = function (name, segmentKeys) {
|
|
19
|
-
var segmentKey = this.keys.buildSegmentNameKey(name);
|
|
20
|
-
if (segmentKeys.length) {
|
|
21
|
-
return this.redis.srem(segmentKey, segmentKeys).then(function () { return true; });
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return Promise.resolve(true);
|
|
25
|
-
}
|
|
16
|
+
return Promise.all([
|
|
17
|
+
addedKeys.length && this.redis.sadd(segmentKey, addedKeys),
|
|
18
|
+
removedKeys.length && this.redis.srem(segmentKey, removedKeys),
|
|
19
|
+
this.redis.set(this.keys.buildSegmentTillKey(name), changeNumber + '')
|
|
20
|
+
]).then(function () {
|
|
21
|
+
return addedKeys.length > 0 || removedKeys.length > 0;
|
|
22
|
+
});
|
|
26
23
|
};
|
|
27
24
|
SegmentsCacheInRedis.prototype.isInSegment = function (name, key) {
|
|
28
25
|
return this.redis.sismember(this.keys.buildSegmentNameKey(name), key).then(function (matches) { return matches !== 0; });
|
|
29
26
|
};
|
|
30
|
-
SegmentsCacheInRedis.prototype.setChangeNumber = function (name, changeNumber) {
|
|
31
|
-
return this.redis.set(this.keys.buildSegmentTillKey(name), changeNumber + '').then(function (status) { return status === 'OK'; });
|
|
32
|
-
};
|
|
33
27
|
SegmentsCacheInRedis.prototype.getChangeNumber = function (name) {
|
|
34
28
|
var _this = this;
|
|
35
29
|
return this.redis.get(this.keys.buildSegmentTillKey(name)).then(function (value) {
|
|
@@ -12,32 +12,19 @@ var SegmentsCachePluggable = /** @class */ (function () {
|
|
|
12
12
|
this.wrapper = wrapper;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* The returned promise is resolved
|
|
17
|
-
* or rejected if wrapper operation fails.
|
|
18
|
-
*/
|
|
19
|
-
SegmentsCachePluggable.prototype.addToSegment = function (name, segmentKeys) {
|
|
20
|
-
var segmentKey = this.keys.buildSegmentNameKey(name);
|
|
21
|
-
if (segmentKeys.length) {
|
|
22
|
-
return this.wrapper.addItems(segmentKey, segmentKeys);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return Promise.resolve();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Remove a list of `segmentKeys` from the given segment `name`.
|
|
30
|
-
* The returned promise is resolved when the operation success
|
|
31
|
-
* or rejected if wrapper operation fails.
|
|
15
|
+
* Update the given segment `name` with the lists of `addedKeys`, `removedKeys` and `changeNumber`.
|
|
16
|
+
* The returned promise is resolved if the operation success, with `true` if the segment was updated (i.e., some key was added or removed),
|
|
17
|
+
* or rejected if it fails (e.g., wrapper operation fails).
|
|
32
18
|
*/
|
|
33
|
-
SegmentsCachePluggable.prototype.
|
|
19
|
+
SegmentsCachePluggable.prototype.update = function (name, addedKeys, removedKeys, changeNumber) {
|
|
34
20
|
var segmentKey = this.keys.buildSegmentNameKey(name);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
return Promise.all([
|
|
22
|
+
addedKeys.length && this.wrapper.addItems(segmentKey, addedKeys),
|
|
23
|
+
removedKeys.length && this.wrapper.removeItems(segmentKey, removedKeys),
|
|
24
|
+
this.wrapper.set(this.keys.buildSegmentTillKey(name), changeNumber + '')
|
|
25
|
+
]).then(function () {
|
|
26
|
+
return addedKeys.length > 0 || removedKeys.length > 0;
|
|
27
|
+
});
|
|
41
28
|
};
|
|
42
29
|
/**
|
|
43
30
|
* Returns a promise that resolves with a boolean value indicating if `key` is part of `name` segment.
|
|
@@ -46,14 +33,6 @@ var SegmentsCachePluggable = /** @class */ (function () {
|
|
|
46
33
|
SegmentsCachePluggable.prototype.isInSegment = function (name, key) {
|
|
47
34
|
return this.wrapper.itemContains(this.keys.buildSegmentNameKey(name), key);
|
|
48
35
|
};
|
|
49
|
-
/**
|
|
50
|
-
* Set till number for the given segment `name`.
|
|
51
|
-
* The returned promise is resolved when the operation success,
|
|
52
|
-
* or rejected if it fails (e.g., wrapper operation fails).
|
|
53
|
-
*/
|
|
54
|
-
SegmentsCachePluggable.prototype.setChangeNumber = function (name, changeNumber) {
|
|
55
|
-
return this.wrapper.set(this.keys.buildSegmentTillKey(name), changeNumber + '');
|
|
56
|
-
};
|
|
57
36
|
/**
|
|
58
37
|
* Get till number or -1 if it's not defined.
|
|
59
38
|
* The returned promise is resolved with the changeNumber or -1 if it doesn't exist or a wrapper operation fails.
|
|
@@ -16,23 +16,30 @@ export function syncManagerOfflineFactory(splitsParserFactory) {
|
|
|
16
16
|
*/
|
|
17
17
|
return function (_a) {
|
|
18
18
|
var settings = _a.settings, readiness = _a.readiness, storage = _a.storage;
|
|
19
|
-
|
|
19
|
+
var mainSyncManager = fromObjectSyncTaskFactory(splitsParserFactory(), storage, readiness, settings);
|
|
20
|
+
var mainStart = mainSyncManager.start;
|
|
21
|
+
var sharedStarts = [];
|
|
22
|
+
return objectAssign(mainSyncManager, {
|
|
23
|
+
start: function () {
|
|
24
|
+
mainStart();
|
|
25
|
+
sharedStarts.forEach(function (cb) { return cb(); });
|
|
26
|
+
sharedStarts.length = 0;
|
|
27
|
+
},
|
|
20
28
|
// fake flush, that resolves immediately
|
|
21
29
|
flush: flush,
|
|
22
30
|
// [Only used for client-side]
|
|
23
31
|
shared: function (matchingKey, readinessManager) {
|
|
32
|
+
// In LOCALHOST mode, shared clients are ready in the next event-loop cycle than created
|
|
33
|
+
// SDK_READY cannot be emitted directly because this will not update the readiness status
|
|
34
|
+
function emitSdkReady() {
|
|
35
|
+
readinessManager.segments.emit(SDK_SEGMENTS_ARRIVED); // SDK_SPLITS_ARRIVED emitted by main SyncManager
|
|
36
|
+
}
|
|
37
|
+
if (mainSyncManager.isRunning())
|
|
38
|
+
setTimeout(emitSdkReady);
|
|
39
|
+
else
|
|
40
|
+
sharedStarts.push(emitSdkReady);
|
|
24
41
|
return {
|
|
25
|
-
start: function () {
|
|
26
|
-
// In LOCALHOST mode, shared clients are ready in the next event-loop cycle than created
|
|
27
|
-
// SDK_READY cannot be emitted directly because this will not update the readiness status
|
|
28
|
-
setTimeout(function () {
|
|
29
|
-
readinessManager.segments.emit(SDK_SEGMENTS_ARRIVED); // SDK_SPLITS_ARRIVED emitted by main SyncManager
|
|
30
|
-
}, 0);
|
|
31
|
-
},
|
|
32
42
|
stop: function () { },
|
|
33
|
-
isRunning: function () {
|
|
34
|
-
return true;
|
|
35
|
-
},
|
|
36
43
|
flush: flush,
|
|
37
44
|
};
|
|
38
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { forOwn } from '../../../utils/lang';
|
|
2
2
|
import { syncTaskFactory } from '../../syncTask';
|
|
3
3
|
import { CONTROL } from '../../../utils/constants';
|
|
4
|
-
import { SDK_SPLITS_ARRIVED, SDK_SEGMENTS_ARRIVED } from '../../../readiness/constants';
|
|
4
|
+
import { SDK_SPLITS_ARRIVED, SDK_SEGMENTS_ARRIVED, SDK_SPLITS_CACHE_LOADED } from '../../../readiness/constants';
|
|
5
5
|
import { SYNC_OFFLINE_DATA, ERROR_SYNC_OFFLINE_LOADING } from '../../../logger/constants';
|
|
6
6
|
/**
|
|
7
7
|
* Offline equivalent of `splitChangesUpdaterFactory`
|
|
@@ -43,8 +43,13 @@ export function fromObjectUpdaterFactory(splitsParser, storage, readiness, setti
|
|
|
43
43
|
readiness.splits.emit(SDK_SPLITS_ARRIVED);
|
|
44
44
|
if (startingUp) {
|
|
45
45
|
startingUp = false;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
Promise.resolve(splitsCache.checkCache()).then(function (cacheReady) {
|
|
47
|
+
// Emits SDK_READY_FROM_CACHE
|
|
48
|
+
if (cacheReady)
|
|
49
|
+
readiness.splits.emit(SDK_SPLITS_CACHE_LOADED);
|
|
50
|
+
// Emits SDK_READY
|
|
51
|
+
readiness.segments.emit(SDK_SEGMENTS_ARRIVED);
|
|
52
|
+
});
|
|
48
53
|
}
|
|
49
54
|
return true;
|
|
50
55
|
});
|