@statsig/client-core 3.32.6 → 3.33.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/package.json +1 -1
- package/src/FlushCoordinator.js +7 -7
- package/src/FlushTypes.d.ts +8 -7
- package/src/FlushTypes.js +8 -10
- package/src/StatsigMetadata.d.ts +1 -1
- package/src/StatsigMetadata.js +1 -1
package/package.json
CHANGED
package/src/FlushCoordinator.js
CHANGED
|
@@ -74,7 +74,7 @@ class FlushCoordinator {
|
|
|
74
74
|
if (this._currentFlushPromise) {
|
|
75
75
|
yield this._currentFlushPromise;
|
|
76
76
|
}
|
|
77
|
-
this._currentFlushPromise = this._executeFlush(FlushTypes_1.
|
|
77
|
+
this._currentFlushPromise = this._executeFlush(FlushTypes_1.FlushTypeValues.Manual).finally(() => {
|
|
78
78
|
this._currentFlushPromise = null;
|
|
79
79
|
this._scheduleNextFlush();
|
|
80
80
|
});
|
|
@@ -88,7 +88,7 @@ class FlushCoordinator {
|
|
|
88
88
|
if (this._currentFlushPromise) {
|
|
89
89
|
yield this._currentFlushPromise;
|
|
90
90
|
}
|
|
91
|
-
this._currentFlushPromise = this._executeFlush(FlushTypes_1.
|
|
91
|
+
this._currentFlushPromise = this._executeFlush(FlushTypes_1.FlushTypeValues.Shutdown)
|
|
92
92
|
.catch((error) => {
|
|
93
93
|
Log_1.Log.error(`Error during shutdown flush: ${error}`);
|
|
94
94
|
})
|
|
@@ -145,10 +145,10 @@ class FlushCoordinator {
|
|
|
145
145
|
this._flushInterval.markFlushAttempt();
|
|
146
146
|
let flushType;
|
|
147
147
|
if (shouldFlushBySize) {
|
|
148
|
-
flushType = FlushTypes_1.
|
|
148
|
+
flushType = FlushTypes_1.FlushTypeValues.ScheduledFullBatch;
|
|
149
149
|
}
|
|
150
150
|
else {
|
|
151
|
-
flushType = FlushTypes_1.
|
|
151
|
+
flushType = FlushTypes_1.FlushTypeValues.ScheduledMaxTime;
|
|
152
152
|
}
|
|
153
153
|
this._currentFlushPromise = this._processNextBatch(flushType)
|
|
154
154
|
.then(() => {
|
|
@@ -180,13 +180,13 @@ class FlushCoordinator {
|
|
|
180
180
|
}
|
|
181
181
|
_processLimitFlushInternal() {
|
|
182
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
-
const success = yield this._processNextBatch(FlushTypes_1.
|
|
183
|
+
const success = yield this._processNextBatch(FlushTypes_1.FlushTypeValues.Limit);
|
|
184
184
|
if (!success) {
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
while (this._flushInterval.hasCompletelyRecoveredFromBackoff() &&
|
|
188
188
|
this.containsAtLeastOneFullBatch()) {
|
|
189
|
-
const success = yield this._processNextBatch(FlushTypes_1.
|
|
189
|
+
const success = yield this._processNextBatch(FlushTypes_1.FlushTypeValues.Limit);
|
|
190
190
|
if (!success) {
|
|
191
191
|
break;
|
|
192
192
|
}
|
|
@@ -302,7 +302,7 @@ class FlushCoordinator {
|
|
|
302
302
|
return false;
|
|
303
303
|
}
|
|
304
304
|
_handleFailure(batch, flushType, statusCode, failurePath, failureErrorMessage, failureDiagnosticBucket, failureDiagnosticMetadata) {
|
|
305
|
-
if (flushType === FlushTypes_1.
|
|
305
|
+
if (flushType === FlushTypes_1.FlushTypeValues.Shutdown) {
|
|
306
306
|
Log_1.Log.warn(`${flushType} flush failed during shutdown. ` +
|
|
307
307
|
`${batch.events.length} event(s) will be saved to storage for retry in next session.`);
|
|
308
308
|
this._saveShutdownFailedEventsToStorage(batch.events);
|
package/src/FlushTypes.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
ScheduledMaxTime
|
|
3
|
-
ScheduledFullBatch
|
|
4
|
-
Limit
|
|
5
|
-
Manual
|
|
6
|
-
Shutdown
|
|
7
|
-
}
|
|
1
|
+
export declare const FlushTypeValues: {
|
|
2
|
+
readonly ScheduledMaxTime: "scheduled:max_time";
|
|
3
|
+
readonly ScheduledFullBatch: "scheduled:full_batch";
|
|
4
|
+
readonly Limit: "limit";
|
|
5
|
+
readonly Manual: "manual";
|
|
6
|
+
readonly Shutdown: "shutdown";
|
|
7
|
+
};
|
|
8
|
+
export type FlushType = (typeof FlushTypeValues)[keyof typeof FlushTypeValues];
|
package/src/FlushTypes.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
FlushType["Shutdown"] = "shutdown";
|
|
12
|
-
})(FlushType || (exports.FlushType = FlushType = {}));
|
|
3
|
+
exports.FlushTypeValues = void 0;
|
|
4
|
+
exports.FlushTypeValues = {
|
|
5
|
+
ScheduledMaxTime: 'scheduled:max_time',
|
|
6
|
+
ScheduledFullBatch: 'scheduled:full_batch',
|
|
7
|
+
Limit: 'limit',
|
|
8
|
+
Manual: 'manual',
|
|
9
|
+
Shutdown: 'shutdown',
|
|
10
|
+
};
|
package/src/StatsigMetadata.d.ts
CHANGED
package/src/StatsigMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StatsigMetadataProvider = exports.SDK_VERSION = void 0;
|
|
4
|
-
exports.SDK_VERSION = '3.
|
|
4
|
+
exports.SDK_VERSION = '3.33.1';
|
|
5
5
|
let metadata = {
|
|
6
6
|
sdkVersion: exports.SDK_VERSION,
|
|
7
7
|
sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
|