@eppo/js-client-sdk-common
Advanced tools
Comparing version 2.2.1 to 2.2.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const application_logger_1 = require("./application-logger"); | ||
const constants_1 = require("./constants"); | ||
@@ -24,10 +25,10 @@ // TODO: change this to a class with methods instead of something that returns a function | ||
previousPollFailed = false; | ||
console.log('Eppo SDK successfully requested initial configuration'); | ||
application_logger_1.logger.info('Eppo SDK successfully requested initial configuration'); | ||
} | ||
catch (pollingError) { | ||
previousPollFailed = true; | ||
console.warn(`Eppo SDK encountered an error with initial poll of configurations: ${pollingError.message}`); | ||
application_logger_1.logger.warn(`Eppo SDK encountered an error with initial poll of configurations: ${pollingError.message}`); | ||
if (--startAttemptsRemaining > 0) { | ||
const jitterMs = randomJitterMs(intervalMs); | ||
console.warn(`Eppo SDK will retry the initial poll again in ${jitterMs} ms (${startAttemptsRemaining} attempts remaining)`); | ||
application_logger_1.logger.warn(`Eppo SDK will retry the initial poll again in ${jitterMs} ms (${startAttemptsRemaining} attempts remaining)`); | ||
await new Promise((resolve) => setTimeout(resolve, jitterMs)); | ||
@@ -37,6 +38,6 @@ } | ||
if (options === null || options === void 0 ? void 0 : options.pollAfterFailedStart) { | ||
console.warn('Eppo SDK initial poll failed; will attempt regular polling'); | ||
application_logger_1.logger.warn('Eppo SDK initial poll failed; will attempt regular polling'); | ||
} | ||
else { | ||
console.error('Eppo SDK initial poll failed. Aborting polling'); | ||
application_logger_1.logger.error('Eppo SDK initial poll failed. Aborting polling'); | ||
stop(); | ||
@@ -54,10 +55,10 @@ } | ||
if (startRegularPolling) { | ||
console.log(`Eppo SDK starting regularly polling every ${intervalMs} ms`); | ||
application_logger_1.logger.info(`Eppo SDK starting regularly polling every ${intervalMs} ms`); | ||
nextTimer = setTimeout(poll, intervalMs); | ||
} | ||
else { | ||
console.log(`Eppo SDK will not poll for configuration updates`); | ||
application_logger_1.logger.info(`Eppo SDK will not poll for configuration updates`); | ||
} | ||
if (startErrorToThrow) { | ||
console.log('Eppo SDK rethrowing start error'); | ||
application_logger_1.logger.info('Eppo SDK rethrowing start error'); | ||
throw startErrorToThrow; | ||
@@ -72,3 +73,3 @@ } | ||
} | ||
console.log('Eppo SDK polling stopped'); | ||
application_logger_1.logger.info('Eppo SDK polling stopped'); | ||
} | ||
@@ -88,3 +89,3 @@ }; | ||
previousPollFailed = false; | ||
console.log('Eppo SDK poll successful; resuming normal polling'); | ||
application_logger_1.logger.info('Eppo SDK poll successful; resuming normal polling'); | ||
} | ||
@@ -94,3 +95,3 @@ } | ||
previousPollFailed = true; | ||
console.warn(`Eppo SDK encountered an error polling configurations: ${error.message}`); | ||
application_logger_1.logger.warn(`Eppo SDK encountered an error polling configurations: ${error.message}`); | ||
const maxTries = 1 + ((_a = options === null || options === void 0 ? void 0 : options.maxPollRetries) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_POLL_CONFIG_REQUEST_RETRIES); | ||
@@ -101,6 +102,6 @@ if (++failedAttempts < maxTries) { | ||
nextPollMs = failureWaitMultiplier * intervalMs + jitterMs; | ||
console.warn(`Eppo SDK will try polling again in ${nextPollMs} ms (${maxTries - failedAttempts} attempts remaining)`); | ||
application_logger_1.logger.warn(`Eppo SDK will try polling again in ${nextPollMs} ms (${maxTries - failedAttempts} attempts remaining)`); | ||
} | ||
else { | ||
console.error(`Eppo SDK reached maximum of ${failedAttempts} failed polling attempts. Stopping polling`); | ||
application_logger_1.logger.error(`Eppo SDK reached maximum of ${failedAttempts} failed polling attempts. Stopping polling`); | ||
stop(); | ||
@@ -107,0 +108,0 @@ } |
@@ -107,5 +107,3 @@ "use strict"; | ||
function compareNumber(attributeValue, conditionValue, compareFn) { | ||
return (typeof attributeValue === 'number' && | ||
typeof conditionValue === 'number' && | ||
compareFn(attributeValue, conditionValue)); | ||
return compareFn(Number(attributeValue), Number(conditionValue)); | ||
} | ||
@@ -112,0 +110,0 @@ function compareSemVer(attributeValue, conditionValue, compareFn) { |
{ | ||
"name": "@eppo/js-client-sdk-common", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Eppo SDK for client-side JavaScript applications (base for both web and react native)", | ||
@@ -70,2 +70,3 @@ "main": "dist/index.js", | ||
"md5": "^2.3.0", | ||
"pino": "^8.19.0", | ||
"semver": "^7.5.4", | ||
@@ -72,0 +73,0 @@ "universal-base64": "^2.1.0" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
821317
89
1705
0
6
1
+ Addedpino@^8.19.0
+ Addedabort-controller@3.0.0(transitive)
+ Addedatomic-sleep@1.0.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedfast-redact@3.5.0(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedon-exit-leak-free@2.1.2(transitive)
+ Addedpino@8.21.0(transitive)
+ Addedpino-abstract-transport@1.2.0(transitive)
+ Addedpino-std-serializers@6.2.2(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedprocess-warning@3.0.0(transitive)
+ Addedquick-format-unescaped@4.0.4(transitive)
+ Addedreadable-stream@4.7.0(transitive)
+ Addedreal-require@0.2.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafe-stable-stringify@2.5.0(transitive)
+ Addedsonic-boom@3.8.1(transitive)
+ Addedsplit2@4.2.0(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedthread-stream@2.7.0(transitive)