Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.
Merged
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
4 changes: 2 additions & 2 deletions .processcube/nodered/.config.nodes.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"node-red": {
"name": "node-red",
"version": "4.0.8",
"version": "4.1.1",
"local": false,
"user": false,
"nodes": {
Expand Down Expand Up @@ -429,7 +429,7 @@
},
"@5minds/node-red-contrib-processcube": {
"name": "@5minds/node-red-contrib-processcube",
"version": "1.16.0",
"version": "1.16.1",
"local": false,
"user": false,
"nodes": {
Expand Down
3 changes: 2 additions & 1 deletion .processcube/nodered/.config.runtime.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"instanceId": "85440fa479689bf6"
"instanceId": "85440fa479689bf6",
"telemetryEnabled": false
}
5 changes: 3 additions & 2 deletions .processcube/nodered/.config.users.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"view-node-status": true,
"view-node-show-label": true,
"view-show-tips": true,
"view-show-welcome-tours": true
"view-show-welcome-tours": true,
"view-node-info-icon": true
},
"tours": {
"welcome": "4.0.8"
"welcome": "4.1.1"
},
"dialog": {
"export": {
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nodered/node-red:4.0.8-22
FROM nodered/node-red:4.1.1-22

# package
USER root
Expand Down
29 changes: 17 additions & 12 deletions externaltask-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ module.exports = function (RED) {
options['workerId'] = this.workername;
}

if (!options['lockDuration'] && process.env.NODE_RED_ETW_LOCK_DURATION) {
options['lockDuration'] = parseInt(process.env.NODE_RED_ETW_LOCK_DURATION) || undefined;
if (!options['lockDuration'] && (process.env.NODE_RED_ETW_LOCK_DURATION || process.env.NODERED_ETW_LOCK_DURATION)) {
options['lockDuration'] = parseInt(process.env.NODE_RED_ETW_LOCK_DURATION || process.env.NODERED_ETW_LOCK_DURATION) || undefined;
Comment on lines +31 to +32
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable check is duplicated. Store process.env.NODE_RED_ETW_LOCK_DURATION || process.env.NODERED_ETW_LOCK_DURATION in a constant to avoid repeating the logic and improve maintainability.

Suggested change
if (!options['lockDuration'] && (process.env.NODE_RED_ETW_LOCK_DURATION || process.env.NODERED_ETW_LOCK_DURATION)) {
options['lockDuration'] = parseInt(process.env.NODE_RED_ETW_LOCK_DURATION || process.env.NODERED_ETW_LOCK_DURATION) || undefined;
const LOCK_DURATION_ENV = process.env.NODE_RED_ETW_LOCK_DURATION || process.env.NODERED_ETW_LOCK_DURATION;
if (!options['lockDuration'] && LOCK_DURATION_ENV) {
options['lockDuration'] = parseInt(LOCK_DURATION_ENV) || undefined;

Copilot uses AI. Check for mistakes.
}

if (!options['longpollingTimeout']) {
options['longpollingTimeout'] = parseInt(process.env.NODE_RED_ETW_LONGPOLLING_TIMEOUT) || undefined;
options['longpollingTimeout'] = parseInt(process.env.NODE_RED_ETW_LONGPOLLING_TIMEOUT || process.env.NODERED_ETW_LONGPOLLING_TIMEOUT) || undefined;
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable check is duplicated. Store process.env.NODE_RED_ETW_LONGPOLLING_TIMEOUT || process.env.NODERED_ETW_LONGPOLLING_TIMEOUT in a constant to avoid repeating the logic and improve maintainability.

Copilot uses AI. Check for mistakes.
}

if (!options['idleTimeout']) {
options['idleTimeout'] = parseInt(process.env.NODE_RED_ETW_IDLE_TIMEOUT) || undefined;
options['idleTimeout'] = parseInt(process.env.NODE_RED_ETW_IDLE_TIMEOUT || process.env.NODERED_ETW_IDLE_TIMEOUT) || undefined;
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable check is duplicated. Store process.env.NODE_RED_ETW_IDLE_TIMEOUT || process.env.NODERED_ETW_IDLE_TIMEOUT in a constant to avoid repeating the logic and improve maintainability.

Copilot uses AI. Check for mistakes.
}

node._subscribed = true;
Expand Down Expand Up @@ -164,7 +164,7 @@ module.exports = function (RED) {
}
};

RED.hooks.add('preDeliver', (sendEvent) => {
const onPreDeliver = (sendEvent) => {
if (node.isHandling() && node.ownMessage(sendEvent.msg)) {

const sourceNode = sendEvent?.source?.node;
Expand All @@ -185,14 +185,15 @@ module.exports = function (RED) {

node.traceExecution(debugMsg);

if (process.env.NODE_RED_ETW_STEP_LOGGING == 'true') {
if (process.env.NODE_RED_ETW_STEP_LOGGING == 'true' || process.env.NODERED_ETW_STEP_LOGGING == 'true') {
node._trace = `'${sourceNode.name || sourceNode.type}'->'${destinationNode.name || destinationNode.type}'`;
node.log(`preDeliver: ${node._trace}`);
}
}
});
};
RED.hooks.add('preDeliver', onPreDeliver);

RED.hooks.add('postDeliver', (sendEvent) => {
const onPostDeliver = (sendEvent) => {
if (node.isHandling() && node.ownMessage(sendEvent.msg)) {
const sourceNode = sendEvent?.source?.node;
const destinationNode = sendEvent?.destination?.node;
Expand All @@ -211,12 +212,13 @@ module.exports = function (RED) {

node.traceExecution(debugMsg);

if (process.env.NODE_RED_ETW_STEP_LOGGING == 'true') {
if (process.env.NODE_RED_ETW_STEP_LOGGING == 'true' || process.env.NODERED_ETW_STEP_LOGGING == 'true') {
node._trace = `'${sourceNode.name || sourceNode.type}'->'${destinationNode.name || destinationNode.type}'`;
node.log(`postDeliver: ${node._trace}`);
}
}
});
};
RED.hooks.add('postDeliver', onPostDeliver);

node.setSubscribedStatus = () => {
this._subscribed = true;
Expand Down Expand Up @@ -440,7 +442,7 @@ module.exports = function (RED) {
externalTaskWorker.onHeartbeat((event, external_task_id) => {
node.setSubscribedStatus();

if (process.env.NODE_RED_ETW_HEARTBEAT_LOGGING == 'true') {
if (process.env.NODE_RED_ETW_HEARTBEAT_LOGGING == 'true' || process.env.NODERED_ETW_HEARTBEAT_LOGGING == 'true') {
if (external_task_id) {
this.log(`subscription (heartbeat:topic ${node.topic}, ${event} for ${external_task_id}).`);
} else {
Expand All @@ -460,7 +462,7 @@ module.exports = function (RED) {

node.setUnsubscribedStatus(error);

if (process.env.NODE_RED_ETW_STOP_IF_FAILED == 'true') {
if (process.env.NODE_RED_ETW_STOP_IF_FAILED == 'true' || process.env.NODERED_ETW_STOP_IF_FAILED == 'true') {
// abort the external task MM: waiting for a fix in the client.ts
externalTaskWorker.abortExternalTaskIfPresent(externalTask.id);
// mark the external task as finished, cause it is gone
Expand All @@ -486,7 +488,10 @@ module.exports = function (RED) {

node.on('close', () => {
try {
RED.hooks.remove('preDeliver', onPreDeliver);
RED.hooks.remove('postDeliver', onPostDeliver);
externalTaskWorker.stop();
node.log('External Task Worker closed.');
} catch {
node.error('Client close failed', {});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@5minds/node-red-contrib-processcube",
"version": "1.16.0",
"version": "1.16.1",
"license": "MIT",
"description": "Node-RED nodes for ProcessCube",
"scripts": {
Expand Down