|
350 | 350 | backoffCount: "cly_hc_backoff_count", |
351 | 351 | consecutiveBackoffCount: "cly_hc_consecutive_backoff_count" |
352 | 352 | }); |
353 | | - var SDK_VERSION = "26.1.1"; |
| 353 | + var SDK_VERSION = "26.1.2"; |
354 | 354 | var SDK_NAME = "javascript_native_web"; |
355 | 355 |
|
356 | 356 | // Using this on document.referrer would return an array with 17 elements in it. The 12th element (array[11]) would be the path we are looking for. Others would be things like password and such (use https://regex101.com/ to check more) |
|
1200 | 1200 | var _clientHintsPromise = /*#__PURE__*/new WeakMap(); |
1201 | 1201 | var _pendingRequestBuffer = /*#__PURE__*/new WeakMap(); |
1202 | 1202 | var _clientHintsBufferTimeoutId = /*#__PURE__*/new WeakMap(); |
| 1203 | + var _changeIdRemoteConfigTimeoutId = /*#__PURE__*/new WeakMap(); |
1203 | 1204 | var _initializeClientHints = /*#__PURE__*/new WeakMap(); |
1204 | 1205 | var _flushPendingRequestBuffer = /*#__PURE__*/new WeakMap(); |
1205 | 1206 | var _getAndSetServerConfig = /*#__PURE__*/new WeakMap(); |
|
1396 | 1397 | _classPrivateFieldInitSpec(this, _clientHintsPromise, void 0); |
1397 | 1398 | _classPrivateFieldInitSpec(this, _pendingRequestBuffer, void 0); |
1398 | 1399 | _classPrivateFieldInitSpec(this, _clientHintsBufferTimeoutId, void 0); |
| 1400 | + _classPrivateFieldInitSpec(this, _changeIdRemoteConfigTimeoutId, void 0); |
1399 | 1401 | /** |
1400 | 1402 | * Fetch User-Agent Client Hints and cache values for metrics enrichment. |
1401 | 1403 | * @private |
|
2201 | 2203 | clearTimeout(_classPrivateFieldGet2(_clientHintsBufferTimeoutId, _this)); |
2202 | 2204 | _classPrivateFieldSet2(_clientHintsBufferTimeoutId, _this, null); |
2203 | 2205 | } |
| 2206 | + if (_classPrivateFieldGet2(_changeIdRemoteConfigTimeoutId, _this)) { |
| 2207 | + clearTimeout(_classPrivateFieldGet2(_changeIdRemoteConfigTimeoutId, _this)); |
| 2208 | + _classPrivateFieldSet2(_changeIdRemoteConfigTimeoutId, _this, null); |
| 2209 | + } |
2204 | 2210 | _classPrivateFieldSet2(_pendingRequestBuffer, _this, null); |
2205 | 2211 | _classPrivateFieldSet2(_clientHintsPromise, _this, null); |
2206 | 2212 | _classPrivateFieldSet2(_uaClientHints, _this, null); |
|
2635 | 2641 | if (_this.remote_config) { |
2636 | 2642 | _classPrivateFieldSet2(_remoteConfigs, _this, {}); |
2637 | 2643 | _classPrivateFieldGet2(_setValueInStorage, _this).call(_this, "cly_remote_configs", _classPrivateFieldGet2(_remoteConfigs, _this)); |
2638 | | - _this.fetch_remote_config(_this.remote_config); |
| 2644 | + if (merge) { |
| 2645 | + if (_classPrivateFieldGet2(_changeIdRemoteConfigTimeoutId, _this)) { |
| 2646 | + clearTimeout(_classPrivateFieldGet2(_changeIdRemoteConfigTimeoutId, _this)); |
| 2647 | + } |
| 2648 | + _classPrivateFieldSet2(_changeIdRemoteConfigTimeoutId, _this, setTimeout(function () { |
| 2649 | + _classPrivateFieldSet2(_changeIdRemoteConfigTimeoutId, _this, null); |
| 2650 | + _this.fetch_remote_config(_this.remote_config); |
| 2651 | + }, 1000)); |
| 2652 | + } else { |
| 2653 | + _this.fetch_remote_config(_this.remote_config); |
| 2654 | + } |
2639 | 2655 | } |
2640 | 2656 | }); |
2641 | 2657 | /** |
|
7642 | 7658 | _classPrivateFieldSet2(_clientHintsPromise, this, null); |
7643 | 7659 | _classPrivateFieldSet2(_pendingRequestBuffer, this, null); |
7644 | 7660 | _classPrivateFieldSet2(_clientHintsBufferTimeoutId, this, null); |
| 7661 | + _classPrivateFieldSet2(_changeIdRemoteConfigTimeoutId, this, null); |
7645 | 7662 | this.app_key = getConfig("app_key", _ob, null); |
7646 | 7663 | this.url = stripTrailingSlash(getConfig("url", _ob, "")); |
7647 | 7664 | this.serialize = getConfig("serialize", _ob, Countly.serialize); |
|
0 commit comments