From 6e44a65c58d8e28668f0d3459b62c0ce0b84849a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Feb 2023 10:51:53 +0100 Subject: [PATCH] fix(deps): update dependency unleash-client to v3.18.0 (#2956) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [unleash-client](https://togithub.com/Unleash/unleash-client-node) | [`3.16.1` -> `3.18.0`](https://renovatebot.com/diffs/npm/unleash-client/3.16.1/3.18.0) | [![age](https://badges.renovateapi.com/packages/npm/unleash-client/3.18.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/unleash-client/3.18.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/unleash-client/3.18.0/compatibility-slim/3.16.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/unleash-client/3.18.0/confidence-slim/3.16.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
Unleash/unleash-client-node ### [`v3.18.0`](https://togithub.com/Unleash/unleash-client-node/blob/HEAD/CHANGELOG.md#​3180) [Compare Source](https://togithub.com/Unleash/unleash-client-node/compare/v3.17.0...v3.18.0) feat: gracefully handle unsuccessful metrics post ([#​414](https://togithub.com/Unleash/unleash-client-node/issues/414)) feat/flush metrics ([#​415](https://togithub.com/Unleash/unleash-client-node/issues/415)) feat: add metrics jitter support ([#​412](https://togithub.com/Unleash/unleash-client-node/issues/412)) fix: Allow SDK to startup when backup data is corrupt ([#​418](https://togithub.com/Unleash/unleash-client-node/issues/418)) fix: flexible-rollout random stickiness is not random enough ([#​417](https://togithub.com/Unleash/unleash-client-node/issues/417)) fix: build correct version on npm version chore(deps): update dependency eslint-plugin-import to v2.27.5 ([#​416](https://togithub.com/Unleash/unleash-client-node/issues/416)) chore(deps): update dependency [@​typescript-eslint/eslint-plugin](https://togithub.com/typescript-eslint/eslint-plugin) to v5.48.2 ([#​413](https://togithub.com/Unleash/unleash-client-node/issues/413)) chore(deps): update dependency eslint to v8.32.0 ([#​410](https://togithub.com/Unleash/unleash-client-node/issues/410)) chore(deps): update dependency prettier to v2.8.3 ([#​406](https://togithub.com/Unleash/unleash-client-node/issues/406)) chore(deps): update dependency eslint-plugin-import to v2.27.4 ([#​404](https://togithub.com/Unleash/unleash-client-node/issues/404)) ### [`v3.17.0`](https://togithub.com/Unleash/unleash-client-node/blob/HEAD/CHANGELOG.md#​3170) [Compare Source](https://togithub.com/Unleash/unleash-client-node/compare/v3.16.1...v3.17.0) - feat: Only initialize the SDK once. ([#​368](https://togithub.com/Unleash/unleash-client-node/issues/368)) - fix: upgrade semver to 7.3.8 - fix: add resolution for debug - fix: add resolution for minimatch - fix: add resolution for qs - fix: add resolution for json5 - fix: update yarn.lock - docs: Update the readme with info from docs.getunleash ([#​399](https://togithub.com/Unleash/unleash-client-node/issues/399)) - docs: minor fix in README - chore(deps): update dependency debug to v4 ([#​402](https://togithub.com/Unleash/unleash-client-node/issues/402)) - chore(deps): update dependency json5 to v2 ([#​401](https://togithub.com/Unleash/unleash-client-node/issues/401)) - chore(deps): update dependency eslint to v8.31.0 ([#​394](https://togithub.com/Unleash/unleash-client-node/issues/394)) - chore(deps): update dependency nock to v13.3.0 ([#​400](https://togithub.com/Unleash/unleash-client-node/issues/400)) - chore(deps): update dependency [@​typescript-eslint/eslint-plugin](https://togithub.com/typescript-eslint/eslint-plugin) to v5.48.1 ([#​395](https://togithub.com/Unleash/unleash-client-node/issues/395)) - chore(deps): update dependency eslint-config-prettier to v8.6.0 ([#​396](https://togithub.com/Unleash/unleash-client-node/issues/396)) - chore(deps): update dependency prettier to v2.8.2 ([#​398](https://togithub.com/Unleash/unleash-client-node/issues/398)) - chore(deps): update dependency [@​typescript-eslint/eslint-plugin](https://togithub.com/typescript-eslint/eslint-plugin) to v5.47.1 ([#​346](https://togithub.com/Unleash/unleash-client-node/issues/346)) - chore(deps): update dependency typescript to v4.9.4 ([#​386](https://togithub.com/Unleash/unleash-client-node/issues/386)) - chore(deps): update dependency sinon to v15 ([#​391](https://togithub.com/Unleash/unleash-client-node/issues/391)) - chore(deps): update dependency [@​types/node](https://togithub.com/types/node) to v18 ([#​380](https://togithub.com/Unleash/unleash-client-node/issues/380)) - chore(deps): update dependency [@​types/node](https://togithub.com/types/node) to v14.18.36 ([#​382](https://togithub.com/Unleash/unleash-client-node/issues/382)) - chore(deps): update dependency eslint to v8.30.0 ([#​367](https://togithub.com/Unleash/unleash-client-node/issues/367)) - chore(deps): update dependency prettier to v2.8.1 ([#​387](https://togithub.com/Unleash/unleash-client-node/issues/387))
--- ### Configuration ๐Ÿ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). ๐Ÿšฆ **Automerge**: Enabled. โ™ป **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. ๐Ÿ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/Unleash/unleash). --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ivar Conradi ร˜sthus --- package.json | 2 +- src/lib/services/proxy-service.ts | 5 +++-- src/lib/util/feature-evaluator/repository/index.ts | 10 +++++++--- src/lib/util/offline-unleash-client.test.ts | 1 + yarn.lock | 14 +++++++------- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 6db06418a0..63d56eda3e 100644 --- a/package.json +++ b/package.json @@ -133,7 +133,7 @@ "stoppable": "^1.1.0", "ts-toolbelt": "^9.6.0", "type-is": "^1.6.18", - "unleash-client": "3.16.1", + "unleash-client": "3.18.0", "use-deep-compare-effect": "^1.8.1", "uuid": "^9.0.0" }, diff --git a/src/lib/services/proxy-service.ts b/src/lib/services/proxy-service.ts index 5dd9157a4a..2f84d32b51 100644 --- a/src/lib/services/proxy-service.ts +++ b/src/lib/services/proxy-service.ts @@ -5,7 +5,6 @@ import ApiUser from '../types/api-user'; import { Context, InMemStorageProvider, - startUnleash, Unleash, UnleashEvents, } from 'unleash-client'; @@ -134,7 +133,7 @@ export class ProxyService { token, ); - const client = await startUnleash({ + const client = new Unleash({ appName: 'proxy', url: 'unused', storageProvider: new InMemStorageProvider(), @@ -146,6 +145,8 @@ export class ProxyService { this.logger.error(error); }); + await client.start(); + return client; } diff --git a/src/lib/util/feature-evaluator/repository/index.ts b/src/lib/util/feature-evaluator/repository/index.ts index ee4e9433ae..bba8bc1341 100644 --- a/src/lib/util/feature-evaluator/repository/index.ts +++ b/src/lib/util/feature-evaluator/repository/index.ts @@ -2,6 +2,8 @@ import { ClientFeaturesResponse, FeatureInterface } from '../feature'; import { BootstrapProvider } from './bootstrap-provider'; import { StorageProvider } from './storage-provider'; import { Segment } from '../strategy/strategy'; +import { EventEmitter } from 'stream'; +import { UnleashEvents } from 'unleash-client'; export interface RepositoryInterface { getToggle(name: string): FeatureInterface; @@ -20,7 +22,7 @@ interface FeatureToggleData { [key: string]: FeatureInterface; } -export default class Repository { +export default class Repository extends EventEmitter { private timer: NodeJS.Timer | undefined; private appName: string; @@ -38,14 +40,16 @@ export default class Repository { bootstrapProvider, storageProvider, }: RepositoryOptions) { + super(); this.appName = appName; this.bootstrapProvider = bootstrapProvider; this.storageProvider = storageProvider; this.segments = new Map(); } - start(): Promise { - return this.loadBootstrap(); + async start(): Promise { + await this.loadBootstrap(); + process.nextTick(() => this.emit(UnleashEvents.Ready)); } createSegmentLookup(segments: Segment[] | undefined): Map { diff --git a/src/lib/util/offline-unleash-client.test.ts b/src/lib/util/offline-unleash-client.test.ts index c7ec7f3030..607cbe729b 100644 --- a/src/lib/util/offline-unleash-client.test.ts +++ b/src/lib/util/offline-unleash-client.test.ts @@ -22,6 +22,7 @@ export const offlineUnleashClientNode = async ({ appName: context.appName, disableMetrics: true, refreshInterval: 0, + skipInstanceCountWarning: true, url: 'not-needed', storageProvider: new InMemStorageProviderNode(), bootstrap: { diff --git a/yarn.lock b/yarn.lock index 8990e77a80..3ec271759f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3659,7 +3659,7 @@ interpret@^2.2.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== -ip@^1.1.5, ip@^1.1.8: +ip@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.8.tgz#ae05948f6b075435ed3307acce04629da8cdbf48" integrity sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg== @@ -6730,15 +6730,15 @@ universalify@^0.1.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -unleash-client@3.16.1: - version "3.16.1" - resolved "https://registry.yarnpkg.com/unleash-client/-/unleash-client-3.16.1.tgz#81eede77202789eb20eda126d9c7747567bb0628" - integrity sha512-N8c0b2B8LFjfDErCJYMZfAPRZiRRGYFZ0aBLRMnpA1K5iFm/I/TH91UgAGsylOsWngnUKXTST7kYeDgK1Aydug== +unleash-client@3.18.0: + version "3.18.0" + resolved "https://registry.yarnpkg.com/unleash-client/-/unleash-client-3.18.0.tgz#4ea32b38e9b7518ef8816dcaac884a8eb32fea25" + integrity sha512-BCq/m59XgrfgfI05wxdY1n3zAPeAvMMIKkHhKzKgObjRz1ucwPYcPTB3lQTU0foqP7AuieDRHsJxqBpkCCqbCw== dependencies: - ip "^1.1.5" + ip "^1.1.8" make-fetch-happen "^10.2.1" murmurhash3js "^3.0.1" - semver "^7.3.5" + semver "^7.3.8" unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0"