Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Dependency connect-redis from 3.4.0 to 7.1.1 #1387

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions app/server/lib/gristSessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import {parseSubdomain} from 'app/common/gristUrls';
import {isNumber} from 'app/common/gutil';
import {RequestWithOrg} from 'app/server/lib/extractOrg';
import {GristServer} from 'app/server/lib/GristServer';
import log from 'app/server/lib/log';
import {fromCallback} from 'app/server/lib/serverUtils';
import {Sessions} from 'app/server/lib/Sessions';
import {promisifyAll} from 'bluebird';
import * as crypto from 'crypto';
import * as express from 'express';
import assignIn = require('lodash/assignIn');
import assignIn from 'lodash/assignIn';
import * as path from 'path';


Expand Down Expand Up @@ -55,17 +56,25 @@ export interface IGristSession {
function createSessionStoreFactory(sessionsDB: string): () => SessionStore {
if (process.env.REDIS_URL) {
// Note that ./build excludes this module from the electron build.
const RedisStore = require('connect-redis')(session);
const redis = require('redis');
const {RedisStore} = require('connect-redis');
promisifyAll(RedisStore.prototype);
return () => {
const store = new RedisStore({
const client = redis.createClient({
url: process.env.REDIS_URL,
});
client.unref();
client.on('error', (err: any) => {
log.warn(`[Redis Client]: ${err}`);
});
const store = new RedisStore({
client
});
return assignIn(store, {
async close() {
// Quit the client, so that it doesn't attempt to reconnect (which matters for some
// tests), and so that node becomes close-able.
await fromCallback(cb => store.client.quit(cb));
await fromCallback(cb => client.quit(cb));
}});
};
} else {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"color-convert": "2.0.1",
"commander": "9.3.0",
"components-jqueryui": "1.12.1",
"connect-redis": "3.4.0",
"connect-redis": "8.0.1",
"cookie": "0.7.0",
"cookie-parser": "1.4.7",
"csv": "6.3.8",
Expand All @@ -146,6 +146,7 @@
"exceljs": "4.2.1",
"express": "4.20.0",
"express-rate-limit": "7.2.0",
"express-session": "^1.18.1",
"file-type": "16.5.4",
"fs-extra": "7.0.0",
"grain-rpc": "0.1.7",
Expand Down Expand Up @@ -204,6 +205,7 @@
},
"resolutions": {
"**/ip": "https://registry.npmjs.org/neoip/-/neoip-2.1.0.tgz",
"express-session": "https://registry.npmjs.org/@gristlabs/express-session/-/express-session-1.18.1-grist1.tgz",
"jquery": "3.5.0",
"ts-interface-checker": "1.0.2",
"@gristlabs/sqlite3": "5.1.4-grist.8"
Expand Down
58 changes: 34 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2643,13 +2643,10 @@ concat-stream@~1.5.0, concat-stream@~1.5.1:
readable-stream "~2.0.0"
typedarray "~0.0.5"

[email protected]:
version "3.4.0"
resolved "https://registry.yarnpkg.com/connect-redis/-/connect-redis-3.4.0.tgz#4040dd3755bddbf93478fb84937a74052c31b965"
integrity sha512-YKPSO9tLwzUr8jzhsGMdSJUxevWrDt0ggXRcTMb+mtnJ/vWGlWV7RC4VUMgqvZv3uTGDFye8Bf7d6No0oSVkOQ==
dependencies:
debug "^4.0.1"
redis "^2.8.0"
[email protected]:
version "8.0.1"
resolved "https://registry.yarnpkg.com/connect-redis/-/connect-redis-8.0.1.tgz#83d4d829ee968b9d64da9a6f40fe1ea3046bf835"
integrity sha512-7iOI214/r15ahvu0rqKCHhsgpMdOgyLwqlw/icSTnnAR75xFvMyfxAE+je4M87rZLjDlKzKcTc48XxQXYFsMgA==

console-browserify@^1.1.0:
version "1.2.0"
Expand Down Expand Up @@ -2898,7 +2895,7 @@ [email protected]:
dependencies:
ms "2.0.0"

debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@~4.3.1:
debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.0, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@~4.3.1:
version "4.3.7"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52"
integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==
Expand Down Expand Up @@ -3106,7 +3103,7 @@ dotenv@^16.0.3:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f"
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==

[email protected], double-ended-queue@^2.1.0-0:
[email protected]:
version "2.1.0-0"
resolved "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz"
integrity sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=
Expand Down Expand Up @@ -3637,6 +3634,33 @@ [email protected]:
resolved "https://registry.yarnpkg.com/express-rate-limit/-/express-rate-limit-7.2.0.tgz#06ce387dd5388f429cab8263c514fc07bf90a445"
integrity sha512-T7nul1t4TNyfZMJ7pKRKkdeVJWa2CqB8NA1P8BwYaoDI5QSBZARv5oMS43J7b7I5P+4asjVXjb7ONuwDKucahg==

express-session@^1.18.1:
version "1.18.1"
resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.18.1.tgz#88d0bbd41878882840f24ec6227493fcb167e8d5"
integrity sha512-a5mtTqEaZvBCL9A9aqkrtfz+3SMDhOVUnjafjo+s7A9Txkq+SVX2DLvSp1Zrv4uCXa3lMSK3viWnh9Gg07PBUA==
dependencies:
cookie "0.7.2"
cookie-signature "1.0.7"
debug "2.6.9"
depd "~2.0.0"
on-headers "~1.0.2"
parseurl "~1.3.3"
safe-buffer "5.2.1"
uid-safe "~2.1.5"

"express-session@https://registry.npmjs.org/@gristlabs/express-session/-/express-session-1.18.1-grist1.tgz":
version "1.18.1-grist1"
resolved "https://registry.npmjs.org/@gristlabs/express-session/-/express-session-1.18.1-grist1.tgz#8097d2efa29459534fb4706cfc01432d631f701d"
dependencies:
cookie "0.7.2"
cookie-signature "1.0.7"
debug "2.6.9"
depd "~2.0.0"
on-headers "~1.0.2"
parseurl "~1.3.3"
safe-buffer "5.2.1"
uid-safe "~2.1.5"

[email protected]:
version "4.20.0"
resolved "https://registry.yarnpkg.com/express/-/express-4.20.0.tgz#f1d08e591fcec770c07be4767af8eb9bcfd67c48"
Expand Down Expand Up @@ -6704,7 +6728,7 @@ rechoir@^0.7.0:
dependencies:
resolve "^1.9.0"

redis-commands@^1.2.0, redis-commands@^1.7.0:
redis-commands@^1.7.0:
version "1.7.0"
resolved "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz"
integrity sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==
Expand All @@ -6714,11 +6738,6 @@ redis-errors@^1.0.0, redis-errors@^1.2.0:
resolved "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz"
integrity sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==

redis-parser@^2.6.0:
version "2.6.0"
resolved "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz"
integrity sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs=

redis-parser@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz"
Expand All @@ -6736,15 +6755,6 @@ [email protected]:
redis-errors "^1.2.0"
redis-parser "^3.0.0"

redis@^2.8.0:
version "2.8.0"
resolved "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz"
integrity sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A==
dependencies:
double-ended-queue "^2.1.0-0"
redis-commands "^1.2.0"
redis-parser "^2.6.0"

[email protected]:
version "3.1.2"
resolved "https://registry.npmjs.org/redlock/-/redlock-3.1.2.tgz"
Expand Down
Loading