@splitsoftware/splitio-commons 2.1.1-rc.0 → 2.1.1-rc.1
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 +3 -0
- package/README.md +0 -1
- package/cjs/evaluator/combiners/and.js +6 -2
- package/cjs/evaluator/combiners/ifelseif.js +6 -6
- package/cjs/evaluator/condition/index.js +5 -6
- package/cjs/evaluator/index.js +7 -7
- package/cjs/evaluator/matchers/index.js +1 -3
- package/cjs/evaluator/matchers/matcherTypes.js +0 -1
- package/cjs/evaluator/matchersTransform/index.js +0 -4
- package/cjs/evaluator/parser/index.js +2 -2
- package/cjs/evaluator/value/sanitize.js +0 -1
- package/cjs/logger/constants.js +3 -4
- package/cjs/logger/messages/debug.js +2 -3
- package/cjs/logger/messages/error.js +1 -1
- package/cjs/logger/messages/warn.js +2 -2
- package/cjs/sdkClient/client.js +29 -19
- package/cjs/sdkClient/clientAttributesDecoration.js +19 -25
- package/cjs/sdkClient/clientInputValidation.js +28 -26
- package/cjs/services/splitApi.js +2 -2
- package/cjs/storages/AbstractSplitsCacheSync.js +2 -5
- package/cjs/storages/KeyBuilder.js +0 -9
- package/cjs/storages/KeyBuilderCS.js +1 -4
- package/cjs/storages/KeyBuilderSS.js +0 -3
- package/cjs/storages/inLocalStorage/SplitsCacheInLocal.js +14 -9
- package/cjs/storages/inLocalStorage/index.js +0 -4
- package/cjs/storages/inMemory/InMemoryStorage.js +0 -3
- package/cjs/storages/inMemory/InMemoryStorageCS.js +0 -4
- package/cjs/storages/inRedis/index.js +0 -2
- package/cjs/storages/pluggable/index.js +0 -2
- package/cjs/storages/utils.js +1 -0
- package/cjs/sync/polling/fetchers/splitChangesFetcher.js +2 -2
- package/cjs/sync/polling/pollingManagerCS.js +7 -7
- package/cjs/sync/polling/updaters/mySegmentsUpdater.js +2 -2
- package/cjs/sync/polling/updaters/segmentChangesUpdater.js +1 -1
- package/cjs/sync/polling/updaters/splitChangesUpdater.js +35 -51
- package/cjs/sync/streaming/SSEHandler/index.js +0 -1
- package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +77 -106
- package/cjs/sync/streaming/constants.js +1 -2
- package/cjs/sync/streaming/pushManager.js +16 -3
- package/cjs/sync/submitters/impressionsSubmitter.js +3 -2
- package/cjs/sync/syncManagerOnline.js +2 -2
- package/cjs/trackers/strategy/strategyOptimized.js +3 -0
- package/cjs/utils/constants/index.js +2 -3
- package/cjs/utils/inputValidation/eventProperties.js +12 -1
- package/cjs/utils/inputValidation/index.js +3 -1
- package/esm/evaluator/combiners/and.js +6 -2
- package/esm/evaluator/combiners/ifelseif.js +7 -7
- package/esm/evaluator/condition/index.js +5 -6
- package/esm/evaluator/index.js +7 -7
- package/esm/evaluator/matchers/index.js +1 -3
- package/esm/evaluator/matchers/matcherTypes.js +0 -1
- package/esm/evaluator/matchersTransform/index.js +0 -4
- package/esm/evaluator/parser/index.js +2 -2
- package/esm/evaluator/value/sanitize.js +0 -1
- package/esm/logger/constants.js +0 -1
- package/esm/logger/messages/debug.js +2 -3
- package/esm/logger/messages/error.js +1 -1
- package/esm/logger/messages/warn.js +2 -2
- package/esm/sdkClient/client.js +29 -19
- package/esm/sdkClient/clientAttributesDecoration.js +19 -25
- package/esm/sdkClient/clientInputValidation.js +29 -27
- package/esm/services/splitApi.js +2 -2
- package/esm/storages/AbstractSplitsCacheSync.js +2 -5
- package/esm/storages/KeyBuilder.js +0 -9
- package/esm/storages/KeyBuilderCS.js +1 -4
- package/esm/storages/KeyBuilderSS.js +0 -3
- package/esm/storages/inLocalStorage/SplitsCacheInLocal.js +14 -9
- package/esm/storages/inLocalStorage/index.js +0 -4
- package/esm/storages/inMemory/InMemoryStorage.js +0 -3
- package/esm/storages/inMemory/InMemoryStorageCS.js +0 -4
- package/esm/storages/inRedis/index.js +0 -2
- package/esm/storages/pluggable/index.js +0 -2
- package/esm/storages/utils.js +1 -0
- package/esm/sync/polling/fetchers/splitChangesFetcher.js +2 -2
- package/esm/sync/polling/pollingManagerCS.js +7 -7
- package/esm/sync/polling/updaters/mySegmentsUpdater.js +2 -2
- package/esm/sync/polling/updaters/segmentChangesUpdater.js +1 -1
- package/esm/sync/polling/updaters/splitChangesUpdater.js +35 -51
- package/esm/sync/streaming/SSEHandler/index.js +1 -2
- package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +73 -102
- package/esm/sync/streaming/constants.js +0 -1
- package/esm/sync/streaming/pushManager.js +19 -6
- package/esm/sync/submitters/impressionsSubmitter.js +3 -2
- package/esm/sync/syncManagerOnline.js +2 -2
- package/esm/trackers/strategy/strategyOptimized.js +3 -0
- package/esm/utils/constants/index.js +1 -2
- package/esm/utils/inputValidation/eventProperties.js +10 -0
- package/esm/utils/inputValidation/index.js +1 -0
- package/package.json +1 -1
- package/src/dtos/types.ts +8 -32
- package/src/evaluator/Engine.ts +1 -1
- package/src/evaluator/combiners/and.ts +4 -5
- package/src/evaluator/combiners/ifelseif.ts +9 -7
- package/src/evaluator/condition/engineUtils.ts +1 -1
- package/src/evaluator/condition/index.ts +12 -12
- package/src/evaluator/index.ts +7 -7
- package/src/evaluator/matchers/index.ts +1 -3
- package/src/evaluator/matchers/matcherTypes.ts +0 -1
- package/src/evaluator/matchersTransform/index.ts +0 -3
- package/src/evaluator/parser/index.ts +3 -3
- package/src/evaluator/types.ts +2 -2
- package/src/evaluator/value/index.ts +2 -2
- package/src/evaluator/value/sanitize.ts +4 -5
- package/src/logger/constants.ts +0 -1
- package/src/logger/messages/debug.ts +2 -3
- package/src/logger/messages/error.ts +1 -1
- package/src/logger/messages/warn.ts +2 -2
- package/src/sdkClient/client.ts +31 -21
- package/src/sdkClient/clientAttributesDecoration.ts +20 -27
- package/src/sdkClient/clientInputValidation.ts +30 -27
- package/src/sdkManager/index.ts +1 -1
- package/src/services/splitApi.ts +2 -2
- package/src/services/types.ts +1 -1
- package/src/storages/AbstractSplitsCacheSync.ts +3 -6
- package/src/storages/KeyBuilder.ts +0 -12
- package/src/storages/KeyBuilderCS.ts +1 -5
- package/src/storages/KeyBuilderSS.ts +0 -4
- package/src/storages/inLocalStorage/SplitsCacheInLocal.ts +14 -10
- package/src/storages/inLocalStorage/index.ts +0 -4
- package/src/storages/inMemory/InMemoryStorage.ts +0 -3
- package/src/storages/inMemory/InMemoryStorageCS.ts +0 -4
- package/src/storages/inRedis/index.ts +0 -2
- package/src/storages/pluggable/index.ts +0 -2
- package/src/storages/types.ts +1 -33
- package/src/storages/utils.ts +1 -0
- package/src/sync/polling/fetchers/splitChangesFetcher.ts +1 -2
- package/src/sync/polling/fetchers/types.ts +0 -1
- package/src/sync/polling/pollingManagerCS.ts +7 -7
- package/src/sync/polling/types.ts +2 -2
- package/src/sync/polling/updaters/mySegmentsUpdater.ts +2 -2
- package/src/sync/polling/updaters/segmentChangesUpdater.ts +1 -1
- package/src/sync/polling/updaters/splitChangesUpdater.ts +44 -61
- package/src/sync/streaming/SSEHandler/index.ts +1 -2
- package/src/sync/streaming/SSEHandler/types.ts +2 -2
- package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +68 -98
- package/src/sync/streaming/constants.ts +0 -1
- package/src/sync/streaming/parseUtils.ts +2 -2
- package/src/sync/streaming/pushManager.ts +18 -6
- package/src/sync/streaming/types.ts +2 -3
- package/src/sync/submitters/impressionsSubmitter.ts +3 -2
- package/src/sync/submitters/types.ts +23 -33
- package/src/sync/syncManagerOnline.ts +2 -2
- package/src/trackers/strategy/strategyOptimized.ts +3 -0
- package/src/utils/constants/index.ts +1 -2
- package/src/utils/inputValidation/eventProperties.ts +10 -0
- package/src/utils/inputValidation/index.ts +1 -0
- package/src/utils/lang/index.ts +1 -1
- package/types/splitio.d.ts +100 -35
- package/cjs/evaluator/matchers/rbsegment.js +0 -43
- package/cjs/storages/inLocalStorage/RBSegmentsCacheInLocal.js +0 -117
- package/cjs/storages/inMemory/RBSegmentsCacheInMemory.js +0 -61
- package/cjs/storages/inRedis/RBSegmentsCacheInRedis.js +0 -64
- package/cjs/storages/pluggable/RBSegmentsCachePluggable.js +0 -64
- package/esm/evaluator/matchers/rbsegment.js +0 -39
- package/esm/storages/inLocalStorage/RBSegmentsCacheInLocal.js +0 -114
- package/esm/storages/inMemory/RBSegmentsCacheInMemory.js +0 -58
- package/esm/storages/inRedis/RBSegmentsCacheInRedis.js +0 -61
- package/esm/storages/pluggable/RBSegmentsCachePluggable.js +0 -61
- package/src/evaluator/matchers/rbsegment.ts +0 -61
- package/src/storages/inLocalStorage/RBSegmentsCacheInLocal.ts +0 -136
- package/src/storages/inMemory/RBSegmentsCacheInMemory.ts +0 -68
- package/src/storages/inRedis/RBSegmentsCacheInRedis.ts +0 -79
- package/src/storages/pluggable/RBSegmentsCachePluggable.ts +0 -76
|
@@ -1,135 +1,106 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SplitsUpdateWorker = void 0;
|
|
4
|
-
var constants_1 = require("../../../
|
|
5
|
-
var constants_2 = require("../../../readiness/constants");
|
|
4
|
+
var constants_1 = require("../../../readiness/constants");
|
|
6
5
|
var Backoff_1 = require("../../../utils/Backoff");
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var parseUtils_1 = require("../parseUtils");
|
|
10
|
-
var constants_5 = require("./constants");
|
|
6
|
+
var constants_2 = require("../../../utils/constants");
|
|
7
|
+
var constants_3 = require("./constants");
|
|
11
8
|
/**
|
|
12
9
|
* SplitsUpdateWorker factory
|
|
13
10
|
*/
|
|
14
|
-
function SplitsUpdateWorker(log,
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
11
|
+
function SplitsUpdateWorker(log, splitsCache, splitsSyncTask, splitsEventEmitter, telemetryTracker, segmentsSyncTask) {
|
|
12
|
+
var maxChangeNumber = 0;
|
|
13
|
+
var handleNewEvent = false;
|
|
14
|
+
var isHandlingEvent;
|
|
15
|
+
var cdnBypass;
|
|
16
|
+
var payload;
|
|
17
|
+
var backoff = new Backoff_1.Backoff(__handleSplitUpdateCall, constants_3.FETCH_BACKOFF_BASE, constants_3.FETCH_BACKOFF_MAX_WAIT);
|
|
18
|
+
function __handleSplitUpdateCall() {
|
|
19
|
+
isHandlingEvent = true;
|
|
20
|
+
if (maxChangeNumber > splitsCache.getChangeNumber()) {
|
|
21
|
+
handleNewEvent = false;
|
|
22
|
+
var splitUpdateNotification_1 = payload ? { payload: payload, changeNumber: maxChangeNumber } : undefined;
|
|
23
|
+
// fetch splits revalidating data if cached
|
|
24
|
+
splitsSyncTask.execute(true, cdnBypass ? maxChangeNumber : undefined, splitUpdateNotification_1).then(function () {
|
|
25
|
+
if (!isHandlingEvent)
|
|
26
|
+
return; // halt if `stop` has been called
|
|
27
|
+
if (handleNewEvent) {
|
|
28
|
+
__handleSplitUpdateCall();
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (splitUpdateNotification_1)
|
|
32
|
+
telemetryTracker.trackUpdatesFromSSE(constants_2.SPLITS);
|
|
33
|
+
// fetch new registered segments for server-side API. Not retrying on error
|
|
34
|
+
if (segmentsSyncTask)
|
|
35
|
+
segmentsSyncTask.execute(true);
|
|
36
|
+
var attempts = backoff.attempts + 1;
|
|
37
|
+
if (maxChangeNumber <= splitsCache.getChangeNumber()) {
|
|
38
|
+
log.debug("Refresh completed" + (cdnBypass ? ' bypassing the CDN' : '') + " in " + attempts + " attempts.");
|
|
39
|
+
isHandlingEvent = false;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (attempts < constants_3.FETCH_BACKOFF_MAX_RETRIES) {
|
|
43
|
+
backoff.scheduleCall();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (cdnBypass) {
|
|
47
|
+
log.debug("No changes fetched after " + attempts + " attempts with CDN bypassed.");
|
|
48
|
+
isHandlingEvent = false;
|
|
34
49
|
}
|
|
35
50
|
else {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (segmentsSyncTask)
|
|
40
|
-
segmentsSyncTask.execute(true);
|
|
41
|
-
var attempts = backoff.attempts + 1;
|
|
42
|
-
if (ff.isSync() && rbs.isSync()) {
|
|
43
|
-
log.debug("Refresh completed" + (cdnBypass ? ' bypassing the CDN' : '') + " in " + attempts + " attempts.");
|
|
44
|
-
isHandlingEvent = false;
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (attempts < constants_5.FETCH_BACKOFF_MAX_RETRIES) {
|
|
48
|
-
backoff.scheduleCall();
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (cdnBypass) {
|
|
52
|
-
log.debug("No changes fetched after " + attempts + " attempts with CDN bypassed.");
|
|
53
|
-
isHandlingEvent = false;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
backoff.reset();
|
|
57
|
-
cdnBypass = true;
|
|
58
|
-
__handleSplitUpdateCall();
|
|
59
|
-
}
|
|
51
|
+
backoff.reset();
|
|
52
|
+
cdnBypass = true;
|
|
53
|
+
__handleSplitUpdateCall();
|
|
60
54
|
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
isHandlingEvent = false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
/**
|
|
69
|
-
* Invoked by NotificationProcessor on SPLIT_UPDATE or RB_SEGMENT_UPDATE event
|
|
70
|
-
*
|
|
71
|
-
* @param changeNumber - change number of the notification
|
|
72
|
-
*/
|
|
73
|
-
put: function (_a, payload) {
|
|
74
|
-
var changeNumber = _a.changeNumber, pcn = _a.pcn, type = _a.type;
|
|
75
|
-
var currentChangeNumber = cache.getChangeNumber();
|
|
76
|
-
if (changeNumber <= currentChangeNumber || changeNumber <= maxChangeNumber)
|
|
77
|
-
return;
|
|
78
|
-
maxChangeNumber = changeNumber;
|
|
79
|
-
handleNewEvent = true;
|
|
80
|
-
cdnBypass = false;
|
|
81
|
-
instantUpdate = undefined;
|
|
82
|
-
if (payload && currentChangeNumber === pcn) {
|
|
83
|
-
instantUpdate = { payload: payload, changeNumber: changeNumber, type: type };
|
|
84
55
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
isHandlingEvent = false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Invoked by NotificationProcessor on SPLIT_UPDATE event
|
|
64
|
+
*
|
|
65
|
+
* @param changeNumber - change number of the SPLIT_UPDATE notification
|
|
66
|
+
*/
|
|
67
|
+
function put(_a, _payload) {
|
|
68
|
+
var changeNumber = _a.changeNumber, pcn = _a.pcn;
|
|
69
|
+
var currentChangeNumber = splitsCache.getChangeNumber();
|
|
70
|
+
if (changeNumber <= currentChangeNumber || changeNumber <= maxChangeNumber)
|
|
71
|
+
return;
|
|
72
|
+
maxChangeNumber = changeNumber;
|
|
73
|
+
handleNewEvent = true;
|
|
74
|
+
cdnBypass = false;
|
|
75
|
+
payload = undefined;
|
|
76
|
+
if (_payload && currentChangeNumber === pcn) {
|
|
77
|
+
payload = _payload;
|
|
78
|
+
}
|
|
79
|
+
if (backoff.timeoutID || !isHandlingEvent)
|
|
80
|
+
__handleSplitUpdateCall();
|
|
81
|
+
backoff.reset();
|
|
97
82
|
}
|
|
98
83
|
return {
|
|
99
|
-
put:
|
|
100
|
-
if (parsedData.d && parsedData.c !== undefined) {
|
|
101
|
-
try {
|
|
102
|
-
var payload = (0, parseUtils_1.parseFFUpdatePayload)(parsedData.c, parsedData.d);
|
|
103
|
-
if (payload) {
|
|
104
|
-
(parsedData.type === constants_4.RB_SEGMENT_UPDATE ? rbs : ff).put(parsedData, payload);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
catch (e) {
|
|
109
|
-
log.warn(constants_1.STREAMING_PARSING_SPLIT_UPDATE, [parsedData.type, e]);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
(parsedData.type === constants_4.RB_SEGMENT_UPDATE ? rbs : ff).put(parsedData);
|
|
113
|
-
},
|
|
84
|
+
put: put,
|
|
114
85
|
/**
|
|
115
86
|
* Invoked by NotificationProcessor on SPLIT_KILL event
|
|
116
87
|
*
|
|
117
|
-
* @param changeNumber - change number of the notification
|
|
88
|
+
* @param changeNumber - change number of the SPLIT_UPDATE notification
|
|
118
89
|
* @param splitName - name of split to kill
|
|
119
90
|
* @param defaultTreatment - default treatment value
|
|
120
91
|
*/
|
|
121
92
|
killSplit: function (_a) {
|
|
122
93
|
var changeNumber = _a.changeNumber, splitName = _a.splitName, defaultTreatment = _a.defaultTreatment;
|
|
123
|
-
if (
|
|
94
|
+
if (splitsCache.killLocally(splitName, defaultTreatment, changeNumber)) {
|
|
124
95
|
// trigger an SDK_UPDATE if Split was killed locally
|
|
125
|
-
splitsEventEmitter.emit(
|
|
96
|
+
splitsEventEmitter.emit(constants_1.SDK_SPLITS_ARRIVED, true);
|
|
126
97
|
}
|
|
127
98
|
// queues the SplitChanges fetch (only if changeNumber is newer)
|
|
128
|
-
|
|
99
|
+
put({ changeNumber: changeNumber });
|
|
129
100
|
},
|
|
130
101
|
stop: function () {
|
|
131
|
-
|
|
132
|
-
|
|
102
|
+
isHandlingEvent = false;
|
|
103
|
+
backoff.reset();
|
|
133
104
|
}
|
|
134
105
|
};
|
|
135
106
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ControlType = exports.OCCUPANCY = exports.CONTROL = exports.
|
|
3
|
+
exports.ControlType = exports.OCCUPANCY = exports.CONTROL = exports.SPLIT_UPDATE = exports.SPLIT_KILL = exports.SEGMENT_UPDATE = exports.MEMBERSHIPS_LS_UPDATE = exports.MEMBERSHIPS_MS_UPDATE = exports.PUSH_SUBSYSTEM_DOWN = exports.PUSH_SUBSYSTEM_UP = exports.PUSH_RETRYABLE_ERROR = exports.PUSH_NONRETRYABLE_ERROR = exports.SECONDS_BEFORE_EXPIRATION = void 0;
|
|
4
4
|
// time for refresh token
|
|
5
5
|
exports.SECONDS_BEFORE_EXPIRATION = 600;
|
|
6
6
|
// Internal SDK events, subscribed by SyncManager and PushManager
|
|
@@ -30,7 +30,6 @@ exports.MEMBERSHIPS_LS_UPDATE = 'MEMBERSHIPS_LS_UPDATE';
|
|
|
30
30
|
exports.SEGMENT_UPDATE = 'SEGMENT_UPDATE';
|
|
31
31
|
exports.SPLIT_KILL = 'SPLIT_KILL';
|
|
32
32
|
exports.SPLIT_UPDATE = 'SPLIT_UPDATE';
|
|
33
|
-
exports.RB_SEGMENT_UPDATE = 'RB_SEGMENT_UPDATE';
|
|
34
33
|
// Control-type push notifications, handled by NotificationKeeper
|
|
35
34
|
exports.CONTROL = 'CONTROL';
|
|
36
35
|
exports.OCCUPANCY = 'OCCUPANCY';
|
|
@@ -46,7 +46,7 @@ function pushManagerFactory(params, pollingManager) {
|
|
|
46
46
|
// MySegmentsUpdateWorker (client-side) are initiated in `add` method
|
|
47
47
|
var segmentsUpdateWorker = userKey ? undefined : (0, SegmentsUpdateWorker_1.SegmentsUpdateWorker)(log, pollingManager.segmentsSyncTask, storage.segments);
|
|
48
48
|
// For server-side we pass the segmentsSyncTask, used by SplitsUpdateWorker to fetch new segments
|
|
49
|
-
var splitsUpdateWorker = (0, SplitsUpdateWorker_1.SplitsUpdateWorker)(log, storage, pollingManager.splitsSyncTask, readiness.splits, telemetryTracker, userKey ? undefined : pollingManager.segmentsSyncTask);
|
|
49
|
+
var splitsUpdateWorker = (0, SplitsUpdateWorker_1.SplitsUpdateWorker)(log, storage.splits, pollingManager.splitsSyncTask, readiness.splits, telemetryTracker, userKey ? undefined : pollingManager.segmentsSyncTask);
|
|
50
50
|
// [Only for client-side] map of hashes to user keys, to dispatch membership update events to the corresponding MySegmentsUpdateWorker
|
|
51
51
|
var userKeyHashes = {};
|
|
52
52
|
// [Only for client-side] map of user keys to their corresponding hash64 and MySegmentsUpdateWorkers.
|
|
@@ -182,8 +182,21 @@ function pushManagerFactory(params, pollingManager) {
|
|
|
182
182
|
});
|
|
183
183
|
/** Functions related to synchronization (Queues and Workers in the spec) */
|
|
184
184
|
pushEmitter.on(constants_1.SPLIT_KILL, splitsUpdateWorker.killSplit);
|
|
185
|
-
pushEmitter.on(constants_1.SPLIT_UPDATE,
|
|
186
|
-
|
|
185
|
+
pushEmitter.on(constants_1.SPLIT_UPDATE, function (parsedData) {
|
|
186
|
+
if (parsedData.d && parsedData.c !== undefined) {
|
|
187
|
+
try {
|
|
188
|
+
var payload = (0, parseUtils_1.parseFFUpdatePayload)(parsedData.c, parsedData.d);
|
|
189
|
+
if (payload) {
|
|
190
|
+
splitsUpdateWorker.put(parsedData, payload);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch (e) {
|
|
195
|
+
log.warn(constants_2.STREAMING_PARSING_SPLIT_UPDATE, [e]);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
splitsUpdateWorker.put(parsedData);
|
|
199
|
+
});
|
|
187
200
|
function handleMySegmentsUpdate(parsedData) {
|
|
188
201
|
switch (parsedData.u) {
|
|
189
202
|
case types_1.UpdateStrategy.BoundedFetchRequest: {
|
|
@@ -22,8 +22,9 @@ function fromImpressionsCollector(sendLabels, data) {
|
|
|
22
22
|
m: entry.time,
|
|
23
23
|
c: entry.changeNumber,
|
|
24
24
|
r: sendLabels ? entry.label : undefined,
|
|
25
|
-
b: entry.bucketingKey
|
|
26
|
-
pt: entry.pt
|
|
25
|
+
b: entry.bucketingKey,
|
|
26
|
+
pt: entry.pt,
|
|
27
|
+
properties: entry.properties // Properties
|
|
27
28
|
};
|
|
28
29
|
return keyImpression;
|
|
29
30
|
})
|
|
@@ -125,7 +125,7 @@ function syncManagerOnlineFactory(pollingManagerFactory, pushManagerFactory) {
|
|
|
125
125
|
if (pushManager) {
|
|
126
126
|
if (pollingManager.isRunning()) {
|
|
127
127
|
// if doing polling, we must start the periodic fetch of data
|
|
128
|
-
if (storage.splits.usesSegments()
|
|
128
|
+
if (storage.splits.usesSegments())
|
|
129
129
|
mySegmentsSyncTask.start();
|
|
130
130
|
}
|
|
131
131
|
else {
|
|
@@ -135,7 +135,7 @@ function syncManagerOnlineFactory(pollingManagerFactory, pushManagerFactory) {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
else {
|
|
138
|
-
if (storage.splits.usesSegments()
|
|
138
|
+
if (storage.splits.usesSegments())
|
|
139
139
|
mySegmentsSyncTask.start();
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -12,6 +12,9 @@ var time_1 = require("../../utils/time");
|
|
|
12
12
|
function strategyOptimizedFactory(impressionsObserver, impressionCounts) {
|
|
13
13
|
return {
|
|
14
14
|
process: function (impression) {
|
|
15
|
+
// DEBUG mode without previous time, for impressions with properties
|
|
16
|
+
if (impression.properties)
|
|
17
|
+
return true;
|
|
15
18
|
impression.pt = impressionsObserver.testAndSet(impression);
|
|
16
19
|
var now = Date.now();
|
|
17
20
|
// Increments impression counter per featureName
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MEMBERSHIPS = exports.SEGMENT = exports.TOKEN = exports.TELEMETRY = exports.EVENTS = exports.IMPRESSIONS_COUNT = exports.IMPRESSIONS = exports.SPLITS = exports.NONE_ENUM = exports.DEBUG_ENUM = exports.OPTIMIZED_ENUM = exports.CONSUMER_PARTIAL_ENUM = exports.CONSUMER_ENUM = exports.STANDALONE_ENUM = exports.DEDUPED = exports.DROPPED = exports.QUEUED = exports.NAMES_FN_LABEL = exports.SPLITS_FN_LABEL = exports.SPLIT_FN_LABEL = exports.TRACK_FN_LABEL = exports.GET_TREATMENTS_WITH_CONFIG_BY_FLAG_SETS = exports.GET_TREATMENTS_WITH_CONFIG_BY_FLAG_SET = exports.GET_TREATMENTS_BY_FLAG_SETS = exports.GET_TREATMENTS_BY_FLAG_SET = exports.GET_TREATMENTS_WITH_CONFIG = exports.GET_TREATMENT_WITH_CONFIG = exports.GET_TREATMENTS = exports.GET_TREATMENT = exports.CONSENT_UNKNOWN = exports.CONSENT_DECLINED = exports.CONSENT_GRANTED = exports.STORAGE_PLUGGABLE = exports.STORAGE_REDIS = exports.STORAGE_LOCALSTORAGE = exports.STORAGE_MEMORY = exports.CONSUMER_PARTIAL_MODE = exports.CONSUMER_MODE = exports.PRODUCER_MODE = exports.STANDALONE_MODE = exports.LOCALHOST_MODE = exports.NONE = exports.OPTIMIZED = exports.DEBUG = exports.SPLIT_EVENT = exports.SPLIT_IMPRESSION = exports.NA = exports.UNKNOWN = exports.CONTROL_WITH_CONFIG = exports.CONTROL = void 0;
|
|
4
|
-
exports.
|
|
4
|
+
exports.IN_LARGE_SEGMENT = exports.IN_SEGMENT = exports.FLAG_SPEC_VERSION = exports.PAUSED = exports.ENABLED = exports.DISABLED = exports.NON_REQUESTED = exports.REQUESTED = exports.POLLING = exports.STREAMING = exports.AUTH_REJECTION = exports.SYNC_MODE_UPDATE = exports.ABLY_ERROR = exports.TOKEN_REFRESH = exports.SSE_CONNECTION_ERROR = exports.STREAMING_STATUS = exports.OCCUPANCY_SEC = exports.OCCUPANCY_PRI = exports.CONNECTION_ESTABLISHED = exports.TRACK = exports.TREATMENTS_WITH_CONFIG_BY_FLAGSETS = exports.TREATMENTS_WITH_CONFIG_BY_FLAGSET = exports.TREATMENTS_BY_FLAGSETS = exports.TREATMENTS_BY_FLAGSET = exports.TREATMENTS_WITH_CONFIG = exports.TREATMENT_WITH_CONFIG = exports.TREATMENTS = exports.TREATMENT = void 0;
|
|
5
5
|
// Special treatments
|
|
6
6
|
exports.CONTROL = 'control';
|
|
7
7
|
exports.CONTROL_WITH_CONFIG = {
|
|
@@ -90,8 +90,7 @@ exports.NON_REQUESTED = 1;
|
|
|
90
90
|
exports.DISABLED = 0;
|
|
91
91
|
exports.ENABLED = 1;
|
|
92
92
|
exports.PAUSED = 2;
|
|
93
|
-
exports.FLAG_SPEC_VERSION = '1.
|
|
93
|
+
exports.FLAG_SPEC_VERSION = '1.2';
|
|
94
94
|
// Matcher types
|
|
95
95
|
exports.IN_SEGMENT = 'IN_SEGMENT';
|
|
96
96
|
exports.IN_LARGE_SEGMENT = 'IN_LARGE_SEGMENT';
|
|
97
|
-
exports.IN_RULE_BASED_SEGMENT = 'IN_RULE_BASED_SEGMENT';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateEventProperties = void 0;
|
|
3
|
+
exports.validateEvaluationOptions = exports.validateEventProperties = void 0;
|
|
4
4
|
var lang_1 = require("../lang");
|
|
5
5
|
var objectAssign_1 = require("../lang/objectAssign");
|
|
6
6
|
var constants_1 = require("../../logger/constants");
|
|
@@ -61,3 +61,14 @@ function validateEventProperties(log, maybeProperties, method) {
|
|
|
61
61
|
return output;
|
|
62
62
|
}
|
|
63
63
|
exports.validateEventProperties = validateEventProperties;
|
|
64
|
+
function validateEvaluationOptions(log, maybeOptions, method) {
|
|
65
|
+
if ((0, lang_1.isObject)(maybeOptions)) {
|
|
66
|
+
var properties = validateEventProperties(log, maybeOptions.properties, method).properties;
|
|
67
|
+
return properties && Object.keys(properties).length > 0 ? { properties: properties } : undefined;
|
|
68
|
+
}
|
|
69
|
+
else if (maybeOptions) {
|
|
70
|
+
log.error(constants_1.ERROR_NOT_PLAIN_OBJECT, [method, 'evaluation options']);
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
exports.validateEvaluationOptions = validateEvaluationOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validatePreloadedData = exports.validateTrafficTypeExistence = exports.validateSplitExistence = exports.validateIfOperational = exports.validateIfNotDestroyed = exports.validateTrafficType = exports.validateSplits = exports.validateSplit = exports.validateKey = exports.validateEventProperties = exports.validateEventValue = exports.validateEvent = exports.validateAttributes = exports.releaseApiKey = exports.validateAndTrackApiKey = exports.validateApiKey = void 0;
|
|
3
|
+
exports.validateEvaluationOptions = exports.validatePreloadedData = exports.validateTrafficTypeExistence = exports.validateSplitExistence = exports.validateIfOperational = exports.validateIfNotDestroyed = exports.validateTrafficType = exports.validateSplits = exports.validateSplit = exports.validateKey = exports.validateEventProperties = exports.validateEventValue = exports.validateEvent = exports.validateAttributes = exports.releaseApiKey = exports.validateAndTrackApiKey = exports.validateApiKey = void 0;
|
|
4
4
|
var apiKey_1 = require("./apiKey");
|
|
5
5
|
Object.defineProperty(exports, "validateApiKey", { enumerable: true, get: function () { return apiKey_1.validateApiKey; } });
|
|
6
6
|
Object.defineProperty(exports, "validateAndTrackApiKey", { enumerable: true, get: function () { return apiKey_1.validateAndTrackApiKey; } });
|
|
@@ -30,3 +30,5 @@ var trafficTypeExistence_1 = require("./trafficTypeExistence");
|
|
|
30
30
|
Object.defineProperty(exports, "validateTrafficTypeExistence", { enumerable: true, get: function () { return trafficTypeExistence_1.validateTrafficTypeExistence; } });
|
|
31
31
|
var preloadedData_1 = require("./preloadedData");
|
|
32
32
|
Object.defineProperty(exports, "validatePreloadedData", { enumerable: true, get: function () { return preloadedData_1.validatePreloadedData; } });
|
|
33
|
+
var eventProperties_2 = require("./eventProperties");
|
|
34
|
+
Object.defineProperty(exports, "validateEvaluationOptions", { enumerable: true, get: function () { return eventProperties_2.validateEvaluationOptions; } });
|
|
@@ -8,8 +8,12 @@ export function andCombinerContext(log, matchers) {
|
|
|
8
8
|
log.debug(ENGINE_COMBINER_AND, [hasMatchedAll]);
|
|
9
9
|
return hasMatchedAll;
|
|
10
10
|
}
|
|
11
|
-
return function andCombiner(
|
|
12
|
-
var
|
|
11
|
+
return function andCombiner() {
|
|
12
|
+
var params = [];
|
|
13
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
14
|
+
params[_i] = arguments[_i];
|
|
15
|
+
}
|
|
16
|
+
var matcherResults = matchers.map(function (matcher) { return matcher.apply(void 0, params); });
|
|
13
17
|
// If any matching result is a thenable we should use Promise.all
|
|
14
18
|
if (findIndex(matcherResults, thenable) !== -1) {
|
|
15
19
|
return Promise.all(matcherResults).then(andResults);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { findIndex
|
|
1
|
+
import { findIndex } from '../../utils/lang';
|
|
2
2
|
import { thenable } from '../../utils/promise/thenable';
|
|
3
3
|
import { UNSUPPORTED_MATCHER_TYPE } from '../../utils/labels';
|
|
4
4
|
import { CONTROL } from '../../utils/constants';
|
|
@@ -11,12 +11,12 @@ export function ifElseIfCombinerContext(log, predicates) {
|
|
|
11
11
|
label: UNSUPPORTED_MATCHER_TYPE
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
14
|
+
function computeTreatment(predicateResults) {
|
|
15
|
+
var len = predicateResults.length;
|
|
16
|
+
for (var i = 0; i < len; i++) {
|
|
16
17
|
var evaluation = predicateResults[i];
|
|
17
18
|
if (evaluation !== undefined) {
|
|
18
|
-
|
|
19
|
-
log.debug(ENGINE_COMBINER_IFELSEIF, [evaluation.treatment]);
|
|
19
|
+
log.debug(ENGINE_COMBINER_IFELSEIF, [evaluation.treatment]);
|
|
20
20
|
return evaluation;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -30,9 +30,9 @@ export function ifElseIfCombinerContext(log, predicates) {
|
|
|
30
30
|
var predicateResults = predicates.map(function (evaluator) { return evaluator(key, seed, trafficAllocation, trafficAllocationSeed, attributes, splitEvaluator); });
|
|
31
31
|
// if we find a thenable
|
|
32
32
|
if (findIndex(predicateResults, thenable) !== -1) {
|
|
33
|
-
return Promise.all(predicateResults).then(function (results) { return
|
|
33
|
+
return Promise.all(predicateResults).then(function (results) { return computeTreatment(results); });
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return computeTreatment(predicateResults);
|
|
36
36
|
}
|
|
37
37
|
// if there is none predicates, then there was an error in parsing phase
|
|
38
38
|
if (!Array.isArray(predicates) || predicates.length === 0) {
|
|
@@ -4,12 +4,11 @@ import { NOT_IN_SPLIT } from '../../utils/labels';
|
|
|
4
4
|
// Build Evaluation object if and only if matchingResult is true
|
|
5
5
|
function match(log, matchingResult, bucketingKey, seed, treatments, label) {
|
|
6
6
|
if (matchingResult) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
true;
|
|
7
|
+
var treatment = getTreatment(log, bucketingKey, seed, treatments);
|
|
8
|
+
return {
|
|
9
|
+
treatment: treatment,
|
|
10
|
+
label: label
|
|
11
|
+
};
|
|
13
12
|
}
|
|
14
13
|
// else we should notify the engine to continue evaluating
|
|
15
14
|
return undefined;
|
package/esm/evaluator/index.js
CHANGED
|
@@ -26,12 +26,12 @@ export function evaluateFeature(log, key, splitName, attributes, storage) {
|
|
|
26
26
|
return treatmentException;
|
|
27
27
|
}
|
|
28
28
|
if (thenable(parsedSplit)) {
|
|
29
|
-
return parsedSplit.then(function (split) { return getEvaluation(log,
|
|
29
|
+
return parsedSplit.then(function (split) { return getEvaluation(log, split, key, attributes, storage); }).catch(
|
|
30
30
|
// Exception on async `getSplit` storage. For example, when the storage is redis or
|
|
31
31
|
// pluggable and there is a connection issue and we can't retrieve the split to be evaluated
|
|
32
32
|
function () { return treatmentException; });
|
|
33
33
|
}
|
|
34
|
-
return getEvaluation(log,
|
|
34
|
+
return getEvaluation(log, parsedSplit, key, attributes, storage);
|
|
35
35
|
}
|
|
36
36
|
export function evaluateFeatures(log, key, splitNames, attributes, storage) {
|
|
37
37
|
var parsedSplits;
|
|
@@ -43,13 +43,13 @@ export function evaluateFeatures(log, key, splitNames, attributes, storage) {
|
|
|
43
43
|
return treatmentsException(splitNames);
|
|
44
44
|
}
|
|
45
45
|
return thenable(parsedSplits) ?
|
|
46
|
-
parsedSplits.then(function (splits) { return getEvaluations(log,
|
|
46
|
+
parsedSplits.then(function (splits) { return getEvaluations(log, splitNames, splits, key, attributes, storage); })
|
|
47
47
|
.catch(function () {
|
|
48
48
|
// Exception on async `getSplits` storage. For example, when the storage is redis or
|
|
49
49
|
// pluggable and there is a connection issue and we can't retrieve the split to be evaluated
|
|
50
50
|
return treatmentsException(splitNames);
|
|
51
51
|
}) :
|
|
52
|
-
getEvaluations(log,
|
|
52
|
+
getEvaluations(log, splitNames, parsedSplits, key, attributes, storage);
|
|
53
53
|
}
|
|
54
54
|
export function evaluateFeaturesByFlagSets(log, key, flagSets, attributes, storage, method) {
|
|
55
55
|
var storedFlagNames;
|
|
@@ -84,7 +84,7 @@ export function evaluateFeaturesByFlagSets(log, key, flagSets, attributes, stora
|
|
|
84
84
|
}) :
|
|
85
85
|
evaluate(storedFlagNames);
|
|
86
86
|
}
|
|
87
|
-
function getEvaluation(log,
|
|
87
|
+
function getEvaluation(log, splitJSON, key, attributes, storage) {
|
|
88
88
|
var evaluation = {
|
|
89
89
|
treatment: CONTROL,
|
|
90
90
|
label: SPLIT_NOT_FOUND,
|
|
@@ -110,11 +110,11 @@ function getEvaluation(log, key, splitJSON, attributes, storage) {
|
|
|
110
110
|
}
|
|
111
111
|
return evaluation;
|
|
112
112
|
}
|
|
113
|
-
function getEvaluations(log,
|
|
113
|
+
function getEvaluations(log, splitNames, splits, key, attributes, storage) {
|
|
114
114
|
var result = {};
|
|
115
115
|
var thenables = [];
|
|
116
116
|
splitNames.forEach(function (splitName) {
|
|
117
|
-
var evaluation = getEvaluation(log,
|
|
117
|
+
var evaluation = getEvaluation(log, splits[splitName], key, attributes, storage);
|
|
118
118
|
if (thenable(evaluation)) {
|
|
119
119
|
thenables.push(evaluation.then(function (res) {
|
|
120
120
|
result[splitName] = res;
|
|
@@ -21,7 +21,6 @@ import { greaterThanEqualToSemverMatcherContext } from './semver_gte';
|
|
|
21
21
|
import { lessThanEqualToSemverMatcherContext } from './semver_lte';
|
|
22
22
|
import { betweenSemverMatcherContext } from './semver_between';
|
|
23
23
|
import { inListSemverMatcherContext } from './semver_inlist';
|
|
24
|
-
import { ruleBasedSegmentMatcherContext } from './rbsegment';
|
|
25
24
|
var matchers = [
|
|
26
25
|
undefined,
|
|
27
26
|
allMatcherContext,
|
|
@@ -46,8 +45,7 @@ var matchers = [
|
|
|
46
45
|
lessThanEqualToSemverMatcherContext,
|
|
47
46
|
betweenSemverMatcherContext,
|
|
48
47
|
inListSemverMatcherContext,
|
|
49
|
-
largeSegmentMatcherContext,
|
|
50
|
-
ruleBasedSegmentMatcherContext // IN_RULE_BASED_SEGMENT: 24
|
|
48
|
+
largeSegmentMatcherContext, // IN_LARGE_SEGMENT: 23
|
|
51
49
|
];
|
|
52
50
|
/**
|
|
53
51
|
* Matcher factory.
|
|
@@ -78,10 +78,6 @@ export function matchersTransform(matchers) {
|
|
|
78
78
|
type === matcherTypes.LESS_THAN_OR_EQUAL_TO_SEMVER) {
|
|
79
79
|
value = stringMatcherData;
|
|
80
80
|
}
|
|
81
|
-
else if (type === matcherTypes.IN_RULE_BASED_SEGMENT) {
|
|
82
|
-
value = segmentTransform(userDefinedSegmentMatcherData);
|
|
83
|
-
dataType = matcherDataTypes.NOT_SPECIFIED;
|
|
84
|
-
}
|
|
85
81
|
return {
|
|
86
82
|
attribute: attribute,
|
|
87
83
|
negate: negate,
|
|
@@ -50,8 +50,8 @@ export function parser(log, conditions, storage) {
|
|
|
50
50
|
// and break the loop
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
|
-
predicates.push(conditionContext(log, andCombinerContext(log, expressions),
|
|
53
|
+
predicates.push(conditionContext(log, andCombinerContext(log, expressions), Treatments.parse(partitions), label, conditionType));
|
|
54
54
|
}
|
|
55
|
-
//
|
|
55
|
+
// Instanciate evaluator given the set of conditions using if else if logic
|
|
56
56
|
return ifElseIfCombinerContext(log, predicates);
|
|
57
57
|
}
|
|
@@ -49,7 +49,6 @@ function getProcessingFunction(matcherTypeID, dataType) {
|
|
|
49
49
|
case matcherTypes.BETWEEN:
|
|
50
50
|
return dataType === 'DATETIME' ? zeroSinceSS : undefined;
|
|
51
51
|
case matcherTypes.IN_SPLIT_TREATMENT:
|
|
52
|
-
case matcherTypes.IN_RULE_BASED_SEGMENT:
|
|
53
52
|
return dependencyProcessor;
|
|
54
53
|
default:
|
|
55
54
|
return undefined;
|
package/esm/logger/constants.js
CHANGED
|
@@ -21,7 +21,6 @@ export var RETRIEVE_MANAGER = 29;
|
|
|
21
21
|
export var SYNC_OFFLINE_DATA = 30;
|
|
22
22
|
export var SYNC_SPLITS_FETCH = 31;
|
|
23
23
|
export var SYNC_SPLITS_UPDATE = 32;
|
|
24
|
-
export var SYNC_RBS_UPDATE = 33;
|
|
25
24
|
export var STREAMING_NEW_MESSAGE = 35;
|
|
26
25
|
export var SYNC_TASK_START = 36;
|
|
27
26
|
export var SYNC_TASK_EXECUTE = 37;
|
|
@@ -19,9 +19,8 @@ export var codesDebug = codesInfo.concat([
|
|
|
19
19
|
[c.RETRIEVE_MANAGER, 'Retrieving manager instance.'],
|
|
20
20
|
// synchronizer
|
|
21
21
|
[c.SYNC_OFFLINE_DATA, c.LOG_PREFIX_SYNC_OFFLINE + 'Feature flags data: \n%s'],
|
|
22
|
-
[c.SYNC_SPLITS_FETCH, c.LOG_PREFIX_SYNC_SPLITS + 'Spin up feature flags update using since = %s
|
|
23
|
-
[c.SYNC_SPLITS_UPDATE, c.LOG_PREFIX_SYNC_SPLITS + 'New feature flags %s. Removed feature flags %s.'],
|
|
24
|
-
[c.SYNC_RBS_UPDATE, c.LOG_PREFIX_SYNC_SPLITS + 'New rule-based segments %s. Removed rule-based segments %s.'],
|
|
22
|
+
[c.SYNC_SPLITS_FETCH, c.LOG_PREFIX_SYNC_SPLITS + 'Spin up feature flags update using since = %s'],
|
|
23
|
+
[c.SYNC_SPLITS_UPDATE, c.LOG_PREFIX_SYNC_SPLITS + 'New feature flags %s. Removed feature flags %s. Segment names collected %s'],
|
|
25
24
|
[c.STREAMING_NEW_MESSAGE, c.LOG_PREFIX_SYNC_STREAMING + 'New SSE message received, with data: %s.'],
|
|
26
25
|
[c.SYNC_TASK_START, c.LOG_PREFIX_SYNC + ': Starting %s. Running each %s millis'],
|
|
27
26
|
[c.SYNC_TASK_EXECUTE, c.LOG_PREFIX_SYNC + ': Running %s'],
|
|
@@ -20,7 +20,7 @@ export var codesError = [
|
|
|
20
20
|
// input validation
|
|
21
21
|
[c.ERROR_EVENT_TYPE_FORMAT, '%s: you passed "%s", event_type must adhere to the regular expression /^[a-zA-Z0-9][-_.:a-zA-Z0-9]{0,79}$/g. This means an event_type must be alphanumeric, cannot be more than 80 characters long, and can only include a dash, underscore, period, or colon as separators of alphanumeric characters.'],
|
|
22
22
|
[c.ERROR_NOT_PLAIN_OBJECT, '%s: %s must be a plain object.'],
|
|
23
|
-
[c.ERROR_SIZE_EXCEEDED, '%s: the maximum size allowed for the properties is 32768 bytes, which was exceeded.
|
|
23
|
+
[c.ERROR_SIZE_EXCEEDED, '%s: the maximum size allowed for the properties is 32768 bytes, which was exceeded.'],
|
|
24
24
|
[c.ERROR_NOT_FINITE, '%s: value must be a finite number.'],
|
|
25
25
|
[c.ERROR_NULL, '%s: you passed a null or undefined %s. It must be a non-empty string.'],
|
|
26
26
|
[c.ERROR_TOO_LONG, '%s: %s too long. It must have 250 characters or less.'],
|
|
@@ -17,7 +17,7 @@ export var codesWarn = codesError.concat([
|
|
|
17
17
|
[c.CLIENT_NO_LISTENER, 'No listeners for SDK Readiness detected. Incorrect control treatments could have been logged if you called getTreatment/s while the SDK was not yet ready.'],
|
|
18
18
|
// input validation
|
|
19
19
|
[c.WARN_SETTING_NULL, '%s: Property "%s" is of invalid type. Setting value to null.'],
|
|
20
|
-
[c.WARN_TRIMMING_PROPERTIES, '%s:
|
|
20
|
+
[c.WARN_TRIMMING_PROPERTIES, '%s: more than 300 properties were provided. Some of them will be trimmed when processed.'],
|
|
21
21
|
[c.WARN_CONVERTING, '%s: %s "%s" is not of type string, converting.'],
|
|
22
22
|
[c.WARN_TRIMMING, '%s: %s "%s" has extra whitespace, trimming.'],
|
|
23
23
|
[c.WARN_NOT_EXISTENT_SPLIT, '%s: feature flag "%s" does not exist in this environment. Please double check what feature flags exist in the Split user interface.'],
|
|
@@ -31,7 +31,7 @@ export var codesWarn = codesError.concat([
|
|
|
31
31
|
[c.WARN_SPLITS_FILTER_EMPTY, c.LOG_PREFIX_SETTINGS + ': feature flag filter configuration must be a non-empty array of filter objects.'],
|
|
32
32
|
[c.WARN_SDK_KEY, c.LOG_PREFIX_SETTINGS + ': You already have %s. We recommend keeping only one instance of the factory at all times (Singleton pattern) and reusing it throughout your application'],
|
|
33
33
|
[c.STREAMING_PARSING_MEMBERSHIPS_UPDATE, c.LOG_PREFIX_SYNC_STREAMING + 'Fetching Memberships due to an error processing %s notification: %s'],
|
|
34
|
-
[c.STREAMING_PARSING_SPLIT_UPDATE, c.LOG_PREFIX_SYNC_STREAMING + 'Fetching SplitChanges due to an error processing
|
|
34
|
+
[c.STREAMING_PARSING_SPLIT_UPDATE, c.LOG_PREFIX_SYNC_STREAMING + 'Fetching SplitChanges due to an error processing SPLIT_UPDATE notification: %s'],
|
|
35
35
|
[c.WARN_INVALID_FLAGSET, '%s: you passed %s, flag set must adhere to the regular expressions %s. This means a flag set must start with a letter or number, be in lowercase, alphanumeric and have a max length of 50 characters. %s was discarded.'],
|
|
36
36
|
[c.WARN_LOWERCASE_FLAGSET, '%s: flag set %s should be all lowercase - converting string to lowercase.'],
|
|
37
37
|
[c.WARN_FLAGSET_WITHOUT_FLAGS, '%s: you passed %s flag set that does not contain cached feature flag names. Please double check what flag sets are in use in the Split user interface.'],
|