From 2f7ad17f042f8d82ad047814144ca76d9dd15752 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Tue, 25 May 2021 23:25:34 +0000 Subject: [PATCH 1/2] fix: package.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-REDIS-1255645 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6025eaa..3d00fda 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "homepage": "https://github.com/osher/fxmgr#readme", "devDependencies": { - "async-redis": "^1.1.7", + "async-redis": "^2.0.0", "eslint": "^7.2.0", "eslint-min": "^0.8.6", "husky": "^4.2.5", @@ -44,7 +44,7 @@ "versi": "^0.6.5" }, "dependencies": { - "async-redis": ">=1.1.7", + "async-redis": ">=2.0.0", "mongodb": ">=3.5.7", "require-yml": "^2.0.0" }, From 0285c321f145a2bbaf2a931263219afecbfd205c Mon Sep 17 00:00:00 2001 From: Osher Date: Tue, 9 Jul 2024 18:30:24 +0300 Subject: [PATCH 2/2] fix: breaking changes of redis-async --- .github/workflows/ci+cd.yml | 6 +++--- .github/workflows/ci.yml | 6 +++--- lib/test-db-redis.js | 10 ++++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci+cd.yml b/.github/workflows/ci+cd.yml index dadaf76..b45985b 100644 --- a/.github/workflows/ci+cd.yml +++ b/.github/workflows/ci+cd.yml @@ -17,9 +17,9 @@ jobs: strategy: matrix: os: [ ubuntu ] #, windows ] - does not support containers yet :( - node: [ 13, 12, 10 ] - mongo: [ 4, 3 ] - redis: [ 5, 4 ] + node: [ 16, 18, 20, 22 ] + mongo: [ 8, 7, 6, 5 ] + redis: [ 7, 6, 5, 4 ] runs-on: ${{ matrix.os }}-latest timeout-minutes: 10 steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba1678d..9ab3f5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,9 @@ jobs: strategy: matrix: os: [ ubuntu ] #, windows ] - does not support containers yet :( - node: [ 13, 12, 10 ] - mongo: [ 4, 3 ] - redis: [ 5, 4 ] + node: [ 16, 18, 20, 22 ] + mongo: [ 8, 7, 6, 5 ] + redis: [ 7, 6, 5, 4 ] runs-on: ${{ matrix.os }}-latest timeout-minutes: 10 steps: diff --git a/lib/test-db-redis.js b/lib/test-db-redis.js index dcd9039..11ae60d 100644 --- a/lib/test-db-redis.js +++ b/lib/test-db-redis.js @@ -15,14 +15,16 @@ module.exports = ({ (c ? Promise.resolve(c) : new Promise( - (accept, reject) => + (accept, reject) => { mgr.client = c = redis(redisOptions) - .on('error', reject) - .once('connect', () => c.removeListener('error', reject) && accept(c)), + c.on('error', reject) + c.once('connect', () => c.removeListener('error', reject) && accept(c)) + return c + }, ) ) .then( - ({ server_info: { redis_version: version, role }, address, selected_db: db = 0 }) => + ({ __redisClient: { server_info: { redis_version: version, role } }, address, selected_db: db = 0 }) => Object.assign(c, { [util.inspect.custom]: () => `${blue('[RedisClient]')} { @ ${color(address)}, role: ${color(role)}, dbVer: ${color(version)}, #db: ${color(db)} }`, //eslint-disable-line max-len }),