@spotify-confidence/openfeature-web-provider
Advanced tools
Comparing version 0.2.0-rc.0 to 0.2.1-rc.0
@@ -44,3 +44,3 @@ "use strict"; | ||
if (context) | ||
this.confidence.updateContextEntry('openFeature', this.convertContext(context || {})); | ||
this.confidence.setContext({ openFeature: this.convertContext(context || {}) }); | ||
this.flagResolution = yield this.confidence.resolve([]); | ||
@@ -63,3 +63,3 @@ this.status = web_sdk_1.ProviderStatus.READY; | ||
try { | ||
this.confidence.updateContextEntry('openFeature', this.convertContext(newContext)); | ||
this.confidence.setContext({ openFeature: this.convertContext(newContext) }); | ||
this.flagResolution = yield this.confidence.resolve([]); | ||
@@ -106,8 +106,2 @@ this.status = web_sdk_1.ProviderStatus.READY; | ||
} | ||
if (!(0, fast_deep_equal_1.default)(this.flagResolution.context, this.convertContext(context))) { | ||
return { | ||
value: defaultValue, | ||
reason: 'STALE', | ||
}; | ||
} | ||
const [flagName, ...pathParts] = flagKey.split('.'); | ||
@@ -163,5 +157,10 @@ try { | ||
logger.info('Value for "%s" successfully evaluated', flagKey); | ||
const currContext = this.convertContext(context); | ||
const cachedContext = this.flagResolution.context; | ||
const reason = Object.keys(currContext).some(key => !(0, fast_deep_equal_1.default)(currContext[key], cachedContext[key])) | ||
? 'STALE' | ||
: mapConfidenceReason(flag.reason); | ||
return { | ||
value: flagValue.value, | ||
reason: mapConfidenceReason(flag.reason), | ||
reason: reason, | ||
variant: flag.variant, | ||
@@ -168,0 +167,0 @@ flagMetadata: { |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
if (context) | ||
this.confidence.updateContextEntry('openFeature', this.convertContext(context || {})); | ||
this.confidence.setContext({ openFeature: this.convertContext(context || {}) }); | ||
this.flagResolution = yield this.confidence.resolve([]); | ||
@@ -57,3 +57,3 @@ this.status = ProviderStatus.READY; | ||
try { | ||
this.confidence.updateContextEntry('openFeature', this.convertContext(newContext)); | ||
this.confidence.setContext({ openFeature: this.convertContext(newContext) }); | ||
this.flagResolution = yield this.confidence.resolve([]); | ||
@@ -100,8 +100,2 @@ this.status = ProviderStatus.READY; | ||
} | ||
if (!equal(this.flagResolution.context, this.convertContext(context))) { | ||
return { | ||
value: defaultValue, | ||
reason: 'STALE', | ||
}; | ||
} | ||
const [flagName, ...pathParts] = flagKey.split('.'); | ||
@@ -157,5 +151,10 @@ try { | ||
logger.info('Value for "%s" successfully evaluated', flagKey); | ||
const currContext = this.convertContext(context); | ||
const cachedContext = this.flagResolution.context; | ||
const reason = Object.keys(currContext).some(key => !equal(currContext[key], cachedContext[key])) | ||
? 'STALE' | ||
: mapConfidenceReason(flag.reason); | ||
return { | ||
value: flagValue.value, | ||
reason: mapConfidenceReason(flag.reason), | ||
reason: reason, | ||
variant: flag.variant, | ||
@@ -162,0 +161,0 @@ flagMetadata: { |
@@ -38,3 +38,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
if (context) | ||
this.confidence.updateContextEntry('openFeature', this.convertContext(context || {})); | ||
this.confidence.setContext({ openFeature: this.convertContext(context || {}) }); | ||
this.flagResolution = yield this.confidence.resolve([]); | ||
@@ -57,3 +57,3 @@ this.status = ProviderStatus.READY; | ||
try { | ||
this.confidence.updateContextEntry('openFeature', this.convertContext(newContext)); | ||
this.confidence.setContext({ openFeature: this.convertContext(newContext) }); | ||
this.flagResolution = yield this.confidence.resolve([]); | ||
@@ -100,8 +100,2 @@ this.status = ProviderStatus.READY; | ||
} | ||
if (!equal(this.flagResolution.context, this.convertContext(context))) { | ||
return { | ||
value: defaultValue, | ||
reason: 'STALE', | ||
}; | ||
} | ||
const [flagName, ...pathParts] = flagKey.split('.'); | ||
@@ -157,5 +151,10 @@ try { | ||
logger.info('Value for "%s" successfully evaluated', flagKey); | ||
const currContext = this.convertContext(context); | ||
const cachedContext = this.flagResolution.context; | ||
const reason = Object.keys(currContext).some(key => !equal(currContext[key], cachedContext[key])) | ||
? 'STALE' | ||
: mapConfidenceReason(flag.reason); | ||
return { | ||
value: flagValue.value, | ||
reason: mapConfidenceReason(flag.reason), | ||
reason: reason, | ||
variant: flag.variant, | ||
@@ -162,0 +161,0 @@ flagMetadata: { |
@@ -9,2 +9,21 @@ # Changelog | ||
## [0.2.1-rc.0](https://github.com/spotify/confidence-openfeature-provider-js/compare/openfeature-web-provider-v0.2.0-rc.0...openfeature-web-provider-v0.2.1-rc.0) (2024-04-24) | ||
### ๐ Bug Fixes | ||
* return the prev assigned value while provider is stale ([#103](https://github.com/spotify/confidence-openfeature-provider-js/issues/103)) ([2faf4c0](https://github.com/spotify/confidence-openfeature-provider-js/commit/2faf4c0f249f4e94d3cdd1d75d959d7c5db960a9)) | ||
### โจ New Features | ||
* managed contexts and events ([#102](https://github.com/spotify/confidence-openfeature-provider-js/issues/102)) ([a6dc75c](https://github.com/spotify/confidence-openfeature-provider-js/commit/a6dc75c147b50cda9ce27a1c0ca622cd191c7142)) | ||
### Dependencies | ||
* The following workspace dependencies were updated | ||
* dependencies | ||
* @spotify-confidence/sdk bumped from 0.0.2 to 0.0.3 | ||
## [0.2.0-rc.0](https://github.com/spotify/confidence-openfeature-provider-js/compare/openfeature-web-provider-v0.1.5...openfeature-web-provider-v0.2.0-rc.0) (2024-04-04) | ||
@@ -11,0 +30,0 @@ |
{ | ||
"name": "@spotify-confidence/openfeature-web-provider", | ||
"license": "Apache-2.0", | ||
"version": "0.2.0-rc.0", | ||
"version": "0.2.1-rc.0", | ||
"module": "build/esm/index.js", | ||
@@ -9,3 +9,3 @@ "main": "build/cjs/index.js", | ||
"dependencies": { | ||
"@spotify-confidence/sdk": "0.0.2", | ||
"@spotify-confidence/sdk": "0.0.3", | ||
"fast-deep-equal": "^3.1.3" | ||
@@ -29,3 +29,3 @@ }, | ||
}, | ||
"gitHead": "86023f5a9cb5c641213ae7754be2395174754119" | ||
"gitHead": "e434adc99a1668ffaf6ac95557a877b4af4c3cfb" | ||
} |
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
195904
745
+ Added@spotify-confidence/sdk@0.0.3(transitive)
+ Addedweb-vitals@3.5.2(transitive)
- Removed@spotify-confidence/sdk@0.0.2(transitive)