@statsig/client-core 1.8.0-beta.10 → 1.8.0-beta.12
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/NetworkCore.js +8 -1
- package/src/StatsigMetadata.d.ts +1 -1
- package/src/StatsigMetadata.js +1 -1
package/package.json
CHANGED
package/src/NetworkCore.js
CHANGED
|
@@ -95,12 +95,15 @@ class NetworkCore {
|
|
|
95
95
|
controller === null || controller === void 0 ? void 0 : controller.abort(`Timeout of ${this._timeout}ms expired.`);
|
|
96
96
|
}, this._timeout);
|
|
97
97
|
const proxyUrl = (_a = args.proxyUrl) !== null && _a !== void 0 ? _a : this._proxy.getProxyUrl(args.sdkKey, args.url);
|
|
98
|
+
console.log('1');
|
|
98
99
|
const url = yield this._getPopulatedURL(Object.assign({ proxyUrl }, args));
|
|
100
|
+
console.log('2');
|
|
99
101
|
const isProxy = !url.includes('https://statsigapi.net/v1');
|
|
100
102
|
const parsedUrl = new URL(url);
|
|
101
103
|
const endpoint = parsedUrl.pathname;
|
|
102
104
|
let response = null;
|
|
103
105
|
const keepalive = (0, VisibilityObserving_1._isUnloading)();
|
|
106
|
+
console.log('3');
|
|
104
107
|
try {
|
|
105
108
|
const config = {
|
|
106
109
|
method,
|
|
@@ -110,6 +113,7 @@ class NetworkCore {
|
|
|
110
113
|
priority: args.priority,
|
|
111
114
|
keepalive,
|
|
112
115
|
};
|
|
116
|
+
console.log('3');
|
|
113
117
|
if (args.isInitialize) {
|
|
114
118
|
Diagnostics_1.Diagnostics._markInitNetworkReqStart(args.sdkKey, {
|
|
115
119
|
attempt: currentAttempt,
|
|
@@ -118,6 +122,7 @@ class NetworkCore {
|
|
|
118
122
|
const func = (_b = this._netConfig.networkOverrideFunc) !== null && _b !== void 0 ? _b : fetch;
|
|
119
123
|
response = yield func(url, config);
|
|
120
124
|
clearTimeout(handle);
|
|
125
|
+
console.log('4');
|
|
121
126
|
if (!response.ok) {
|
|
122
127
|
const text = yield response.text().catch(() => 'No Text');
|
|
123
128
|
const err = new Error(`NetworkError: ${url} ${text}`);
|
|
@@ -131,6 +136,7 @@ class NetworkCore {
|
|
|
131
136
|
}
|
|
132
137
|
console.log('network success!!');
|
|
133
138
|
if (!url.includes('https://prodregistryv2.org')) {
|
|
139
|
+
console.log('pushing success network event!!');
|
|
134
140
|
this.networkEvents.push({
|
|
135
141
|
value: isProxy ? 'proxy' : 'statsig',
|
|
136
142
|
eventName: 'proxy::network_request_tracking',
|
|
@@ -151,6 +157,7 @@ class NetworkCore {
|
|
|
151
157
|
catch (error) {
|
|
152
158
|
console.log('network error!!', error);
|
|
153
159
|
if (!url.includes('https://prodregistryv2.org')) {
|
|
160
|
+
console.log('pushing failure network event!!');
|
|
154
161
|
this.networkEvents.push({
|
|
155
162
|
value: isProxy ? 'proxy' : 'statsig',
|
|
156
163
|
eventName: 'proxy::network_request_tracking',
|
|
@@ -231,10 +238,10 @@ class NetworkCore {
|
|
|
231
238
|
}
|
|
232
239
|
_flushNetworkEvents() {
|
|
233
240
|
var _a;
|
|
241
|
+
console.log('flushing network events!!', this.networkEvents);
|
|
234
242
|
if (this.networkEvents.length === 0) {
|
|
235
243
|
return;
|
|
236
244
|
}
|
|
237
|
-
console.log('flushing network events!!', this.networkEvents);
|
|
238
245
|
this.post({
|
|
239
246
|
sdkKey: (_a = this.sdkKey) !== null && _a !== void 0 ? _a : '',
|
|
240
247
|
url: 'https://prodregistryv2.org/v1/rgstr',
|
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 = '1.8.0-beta.
|
|
4
|
+
exports.SDK_VERSION = '1.8.0-beta.12';
|
|
5
5
|
let metadata = {
|
|
6
6
|
sdkVersion: exports.SDK_VERSION,
|
|
7
7
|
sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
|