You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-07-15 07:14:42 +02:00
fix: patch-package install in docker build and better postgres patch (#17523)
* always patch package when running npm i, install immich CLI outside of directory so post install doesnt run * handles case where query is an object and defined but origin is not. * move patch-package from a dev dependency to a normal dependency. Also copy the patches folder for the docker build to use and patch with * fix Dockerfile * use query.reject instead of throw for queryError * package-lock to reflect the dev dependency change * dont throw the error, just provide an empty string for query.origin if it does not exist * remove npm link and demote patch-package back to a dev dependency * modify patch to add defensive check to catch queries that will fail to parse and reject
This commit is contained in:
@ -1,39 +1,48 @@
|
||||
diff --git a/node_modules/postgres/cf/src/connection.js b/node_modules/postgres/cf/src/connection.js
|
||||
index ee8b1e6..d03b9dd 100644
|
||||
index ee8b1e6..acf4566 100644
|
||||
--- a/node_modules/postgres/cf/src/connection.js
|
||||
+++ b/node_modules/postgres/cf/src/connection.js
|
||||
@@ -387,6 +387,8 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
||||
@@ -387,8 +387,10 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
||||
}
|
||||
|
||||
function queryError(query, err) {
|
||||
+ if (!query || typeof query !== 'object') throw err
|
||||
+ if (!query || typeof query !== 'object' || !query.reject) throw err
|
||||
+
|
||||
'query' in err || 'parameters' in err || Object.defineProperties(err, {
|
||||
stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
|
||||
- stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
|
||||
+ stack: { value: err.stack + (query.origin || '').replace(/.*\n/, '\n'), enumerable: options.debug },
|
||||
query: { value: query.string, enumerable: options.debug },
|
||||
parameters: { value: query.parameters, enumerable: options.debug },
|
||||
args: { value: query.args, enumerable: options.debug },
|
||||
diff --git a/node_modules/postgres/cjs/src/connection.js b/node_modules/postgres/cjs/src/connection.js
|
||||
index f7f58d1..8a37571 100644
|
||||
index f7f58d1..b7f2d65 100644
|
||||
--- a/node_modules/postgres/cjs/src/connection.js
|
||||
+++ b/node_modules/postgres/cjs/src/connection.js
|
||||
@@ -385,6 +385,8 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
||||
@@ -385,8 +385,10 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
||||
}
|
||||
|
||||
function queryError(query, err) {
|
||||
+ if (!query || typeof query !== 'object') throw err
|
||||
+ if (!query || typeof query !== 'object' || !query.reject) throw err
|
||||
+
|
||||
'query' in err || 'parameters' in err || Object.defineProperties(err, {
|
||||
stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
|
||||
- stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
|
||||
+ stack: { value: err.stack + (query.origin || '').replace(/.*\n/, '\n'), enumerable: options.debug },
|
||||
query: { value: query.string, enumerable: options.debug },
|
||||
parameters: { value: query.parameters, enumerable: options.debug },
|
||||
args: { value: query.args, enumerable: options.debug },
|
||||
diff --git a/node_modules/postgres/src/connection.js b/node_modules/postgres/src/connection.js
|
||||
index 97cc97e..58f5298 100644
|
||||
index 97cc97e..26f508e 100644
|
||||
--- a/node_modules/postgres/src/connection.js
|
||||
+++ b/node_modules/postgres/src/connection.js
|
||||
@@ -385,6 +385,8 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
||||
@@ -385,8 +385,10 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
||||
}
|
||||
|
||||
function queryError(query, err) {
|
||||
+ if (!query || typeof query !== 'object') throw err
|
||||
+ if (!query || typeof query !== 'object' || !query.reject) throw err
|
||||
+
|
||||
'query' in err || 'parameters' in err || Object.defineProperties(err, {
|
||||
stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
|
||||
- stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
|
||||
+ stack: { value: err.stack + (query.origin || '').replace(/.*\n/, '\n'), enumerable: options.debug },
|
||||
query: { value: query.string, enumerable: options.debug },
|
||||
parameters: { value: query.parameters, enumerable: options.debug },
|
||||
args: { value: query.args, enumerable: options.debug },
|
||||
|
Reference in New Issue
Block a user