mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
Merge branch 'master' of https://github.com/n8n-io/n8n into node-2212-respond-to-chat-and-wait-for-response
This commit is contained in:
commit
bfb7c93cc4
|
@ -90,6 +90,7 @@
|
||||||
"ws": ">=8.17.1"
|
"ws": ">=8.17.1"
|
||||||
},
|
},
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
|
"bull@4.12.1": "patches/bull@4.12.1.patch",
|
||||||
"pkce-challenge@3.0.0": "patches/pkce-challenge@3.0.0.patch",
|
"pkce-challenge@3.0.0": "patches/pkce-challenge@3.0.0.patch",
|
||||||
"pyodide@0.23.4": "patches/pyodide@0.23.4.patch",
|
"pyodide@0.23.4": "patches/pyodide@0.23.4.patch",
|
||||||
"@types/express-serve-static-core@4.17.43": "patches/@types__express-serve-static-core@4.17.43.patch",
|
"@types/express-serve-static-core@4.17.43": "patches/@types__express-serve-static-core@4.17.43.patch",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { GlobalConfig } from '@n8n/config';
|
import { GlobalConfig } from '@n8n/config';
|
||||||
import { Container, Service } from '@n8n/di';
|
import { Container, Service } from '@n8n/di';
|
||||||
import { ErrorReporter, InstanceSettings, Logger } from 'n8n-core';
|
import { ErrorReporter, InstanceSettings, isObjectLiteral, Logger } from 'n8n-core';
|
||||||
import {
|
import {
|
||||||
ApplicationError,
|
ApplicationError,
|
||||||
BINARY_ENCODING,
|
BINARY_ENCODING,
|
||||||
|
@ -93,6 +93,12 @@ export class ScalingService {
|
||||||
|
|
||||||
void this.queue.process(JOB_TYPE_NAME, concurrency, async (job: Job) => {
|
void this.queue.process(JOB_TYPE_NAME, concurrency, async (job: Job) => {
|
||||||
try {
|
try {
|
||||||
|
if (!this.hasValidJobData(job)) {
|
||||||
|
throw new ApplicationError('Worker received invalid job', {
|
||||||
|
extra: { jobData: jsonStringify(job, { replaceCircularRefs: true }) },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await this.jobProcessor.processJob(job);
|
await this.jobProcessor.processJob(job);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await this.reportJobProcessingError(ensureError(error), job);
|
await this.reportJobProcessingError(ensureError(error), job);
|
||||||
|
@ -503,5 +509,9 @@ export class ScalingService {
|
||||||
: jsonStringify(error, { replaceCircularRefs: true });
|
: jsonStringify(error, { replaceCircularRefs: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private hasValidJobData(job: Job) {
|
||||||
|
return isObjectLiteral(job.data) && 'executionId' in job.data && 'loadStaticData' in job.data;
|
||||||
|
}
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,13 @@ import type {
|
||||||
CanvasEventBusEvents,
|
CanvasEventBusEvents,
|
||||||
ConnectStartEvent,
|
ConnectStartEvent,
|
||||||
} from '@/types';
|
} from '@/types';
|
||||||
import type { Connection, XYPosition, NodeDragEvent, GraphNode } from '@vue-flow/core';
|
import type {
|
||||||
|
Connection,
|
||||||
|
XYPosition,
|
||||||
|
NodeDragEvent,
|
||||||
|
NodeMouseEvent,
|
||||||
|
GraphNode,
|
||||||
|
} from '@vue-flow/core';
|
||||||
import { useVueFlow, VueFlow, PanelPosition, MarkerType } from '@vue-flow/core';
|
import { useVueFlow, VueFlow, PanelPosition, MarkerType } from '@vue-flow/core';
|
||||||
import { MiniMap } from '@vue-flow/minimap';
|
import { MiniMap } from '@vue-flow/minimap';
|
||||||
import Node from './elements/nodes/CanvasNode.vue';
|
import Node from './elements/nodes/CanvasNode.vue';
|
||||||
|
@ -272,6 +278,14 @@ function onNodeDragStop(event: NodeDragEvent) {
|
||||||
onUpdateNodesPosition(event.nodes.map(({ id, position }) => ({ id, position })));
|
onUpdateNodesPosition(event.nodes.map(({ id, position }) => ({ id, position })));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onNodeClick({ event, node }: NodeMouseEvent) {
|
||||||
|
if (event.ctrlKey || event.metaKey || selectedNodes.value.length < 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
onSelectNodes({ ids: [node.id] });
|
||||||
|
}
|
||||||
|
|
||||||
function onSelectionDragStop(event: NodeDragEvent) {
|
function onSelectionDragStop(event: NodeDragEvent) {
|
||||||
onUpdateNodesPosition(event.nodes.map(({ id, position }) => ({ id, position })));
|
onUpdateNodesPosition(event.nodes.map(({ id, position }) => ({ id, position })));
|
||||||
}
|
}
|
||||||
|
@ -676,6 +690,7 @@ provide(CanvasKey, {
|
||||||
@move-start="onPaneMoveStart"
|
@move-start="onPaneMoveStart"
|
||||||
@move-end="onPaneMoveEnd"
|
@move-end="onPaneMoveEnd"
|
||||||
@node-drag-stop="onNodeDragStop"
|
@node-drag-stop="onNodeDragStop"
|
||||||
|
@node-click="onNodeClick"
|
||||||
@selection-drag-stop="onSelectionDragStop"
|
@selection-drag-stop="onSelectionDragStop"
|
||||||
@dragover="onDragOver"
|
@dragover="onDragOver"
|
||||||
@drop="onDrop"
|
@drop="onDrop"
|
||||||
|
|
21
patches/bull@4.12.1.patch
Normal file
21
patches/bull@4.12.1.patch
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
diff --git a/lib/job.js b/lib/job.js
|
||||||
|
index 6a3606974fd3e397c6c5b2b6e65b20670c68f753..4cdbed1d564ceeb5a80c92eb605e49cfd3c8ccdd 100644
|
||||||
|
--- a/lib/job.js
|
||||||
|
+++ b/lib/job.js
|
||||||
|
@@ -511,9 +511,14 @@ Job.prototype.finished = async function() {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
- const onFailed = (jobId, failedReason) => {
|
||||||
|
+ const onFailed = async (jobId, failedReason) => {
|
||||||
|
if (String(jobId) === String(this.id)) {
|
||||||
|
- reject(new Error(failedReason));
|
||||||
|
+ const job = await Job.fromId(this.queue, this.id);
|
||||||
|
+ const error = new Error(failedReason);
|
||||||
|
+ if (job && job.stacktrace && job.stacktrace.length > 0) {
|
||||||
|
+ error.stack = job.stacktrace.join('\n');
|
||||||
|
+ }
|
||||||
|
+ reject(error);
|
||||||
|
removeListeners();
|
||||||
|
}
|
||||||
|
};
|
|
@ -130,6 +130,9 @@ patchedDependencies:
|
||||||
'@types/ws@8.5.4':
|
'@types/ws@8.5.4':
|
||||||
hash: nbzuqaoyqbrfwipijj5qriqqju
|
hash: nbzuqaoyqbrfwipijj5qriqqju
|
||||||
path: patches/@types__ws@8.5.4.patch
|
path: patches/@types__ws@8.5.4.patch
|
||||||
|
bull@4.12.1:
|
||||||
|
hash: ep6h4rqtpclldfcdohxlgcb3aq
|
||||||
|
path: patches/bull@4.12.1.patch
|
||||||
pkce-challenge@3.0.0:
|
pkce-challenge@3.0.0:
|
||||||
hash: dypouzb3lve7vncq25i5fuanki
|
hash: dypouzb3lve7vncq25i5fuanki
|
||||||
path: patches/pkce-challenge@3.0.0.patch
|
path: patches/pkce-challenge@3.0.0.patch
|
||||||
|
@ -822,7 +825,7 @@ importers:
|
||||||
version: 2.4.3
|
version: 2.4.3
|
||||||
bull:
|
bull:
|
||||||
specifier: 4.12.1
|
specifier: 4.12.1
|
||||||
version: 4.12.1
|
version: 4.12.1(patch_hash=ep6h4rqtpclldfcdohxlgcb3aq)
|
||||||
cache-manager:
|
cache-manager:
|
||||||
specifier: 5.2.3
|
specifier: 5.2.3
|
||||||
version: 5.2.3
|
version: 5.2.3
|
||||||
|
@ -19827,7 +19830,7 @@ snapshots:
|
||||||
- supports-color
|
- supports-color
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
bull@4.12.1:
|
bull@4.12.1(patch_hash=ep6h4rqtpclldfcdohxlgcb3aq):
|
||||||
dependencies:
|
dependencies:
|
||||||
cron-parser: 4.9.0
|
cron-parser: 4.9.0
|
||||||
get-port: 5.1.1
|
get-port: 5.1.1
|
||||||
|
|
Loading…
Reference in a new issue