Commit Graph

1142 Commits (1ae8820e2679961d860c41f079c790b983543d24)

Author SHA1 Message Date
Steve-Mcl 7ab239a50d Add debug message pre and post hooks 2026-02-23 11:25:59 +00:00
Nick O'Leary 89b10a0a9d
Merge pull request #5457 from Dennis-SEG/fix/delay-node-race-condition
fix: prevent incorrect array modification in delay node
2026-01-26 09:50:18 +00:00
Dennis-SEG d0cabaf740 fix: prevent race condition in delay node idList splice
Check indexOf result before splicing to prevent removing wrong element
when clearDelayList() runs between timeout registration and execution.

If indexOf returns -1 (id already removed), splice(-1, 1) would incorrectly
remove the last element. Now we skip the splice if id is not found.

Fixes: Dennis-SEG/node-red#3
2026-01-24 23:00:46 +01:00
Dennis-SEG fa5943b235 style: fix indentation in tcpin.js try-catch block 2026-01-18 15:51:44 +01:00
Dennis Bosmans 96bef841a0 fix: prevent uncaught exceptions in core node event handlers
Added try-catch blocks and null checks to event handlers in core nodes
to prevent uncaught exceptions from crashing the Node-RED runtime.

Changes per node:

**TCP (31-tcpin.js)**
- Wrapped all `on('data')` handlers in try-catch (TcpIn client/server, TcpGet)

**UDP (32-udp.js)**
- Wrapped `on('message')` handler in try-catch

**Exec (90-exec.js)**
- Wrapped stdout/stderr `on('data')` handlers in try-catch

**WebSocket (22-websocket.js)**
- Wrapped send() loop in handleEvent() with try-catch

**MQTT (10-mqtt.js)**
- Added null check for packet parameter in subscriptionHandler()
- Wrapped subscription handler callback in try-catch
- Added null check for mpacket.properties

Without these protections, malformed data or unexpected errors in async
event handlers could cause uncaught exceptions that crash the entire
Node-RED process.
2026-01-16 22:22:11 +01:00
Nick O'Leary 721bdbc9aa
Merge pull request #5392 from Dennis-SEG/fix/http-request-uncaught-exceptions
fix(http-request): prevent uncaught exceptions in async hooks
2026-01-07 15:37:36 +00:00
Nick O'Leary bc4f5feede
Merge pull request #5382 from node-red/fix-delay-node-variable-mode-error
Fix flushing when in variable delay mode
2026-01-07 15:16:04 +00:00
Nick O'Leary 60b3569edd
Apply suggestions from code review 2026-01-07 15:07:54 +00:00
Dave Conway-Jones 82a1f12179
Just fix file nodes for now 2026-01-07 15:07:54 +00:00
Nick O'Leary 8287a0aaab
Merge pull request #5412 from kazuhitoyokoi/master-fixstatusnode
Fix status node to retrieve status from all nodes
2026-01-05 17:28:24 +00:00
Nick O'Leary 27ce7cd84d
Merge pull request #5410 from kazuhitoyokoi/master-fixtooltip
Add tooltip to delete button in node property UI
2026-01-05 17:21:26 +00:00
Kazuhito Yokoi cc1662ab5c Fix status node to retrieve status from all nodes 2026-01-04 16:17:16 +09:00
Kazuhito Yokoi bcbd364ddd Add tooltip to delete button 2026-01-03 17:04:01 +09:00
Kazuhito Yokoi 8c594ac627 Decrement count of http requests after error 2026-01-03 14:31:46 +09:00
Dennis-SEG f1b56dc6fa refactor: remove unused getHeaderValue() function 2025-12-24 00:46:07 +01:00
Dennis-SEG 2355709040 fix(http-request): prevent uncaught exceptions in async hooks
This PR fixes several issues that can cause uncaught exceptions and crash Node-RED:

1. Fixed typo: `toLowercase()` -> `toLowerCase()` in getHeaderValue()
2. Added try-catch to beforeRequest hook
3. Added try-catch to beforeRedirect hook
4. Added try-catch to afterResponse hook (digest auth)
5. Added input validation to extractCookies() with array check
6. Added input validation to buildDigestHeader() for nonce/realm

These changes ensure that malformed responses or invalid data from servers
don't crash the entire Node-RED runtime.

Fixes: Uncaught exceptions in HTTP request node
2025-12-23 21:32:49 +01:00
Dave Conway-Jones 636089b586
Fix flushing when in variable delay mode
to close #5381
2025-12-12 22:42:46 +00:00
Nick O'Leary c9b7263e21
Merge pull request #5300 from node-red/5287-fix-httpin-middleware-handling
Do not assume rawBody middleware is last in stack when moving it
2025-10-13 11:17:20 +01:00
Nick O'Leary 471f0d8bea
Do not assume rawBody middleware is last in stack when moving it 2025-10-10 11:35:27 +01:00
Nick O'Leary 0519b94786
Fix jsonata error reporting in Inject node
Fixes #5270
2025-10-09 14:50:52 +01:00
Nick O'Leary 1813a5791d
Merge pull request #5290 from node-red/5283-fix-ui-lockup-for-typed-arrays
Fix UI lock-up when typed arrays are expanded in debug window
2025-10-09 11:24:43 +01:00
Steve-Mcl 36f98133bf Fix UI lock-up when typed arrays are expanded in debug window
closes #5283
2025-10-05 12:18:18 +01:00
Dave Conway-Jones 4ae8fcbc45
Fix range node to handle input min > max
and add tests
and add pin hover to show confiog
2025-08-29 15:08:23 +01:00
Dave Conway-Jones 7b51f30d11
Fix rounding errors for range node when using float inputs and integer outputs
And add extra tests
2025-08-28 15:18:02 +01:00
Nick O'Leary 65785be169
Merge pull request #5241 from kazuhitoyokoi/master-fixhttprequest
Show requesting status correctly in http request node when multiple processes are working
2025-08-28 13:52:30 +01:00
Ben Hardill 54849e9e62
fix test 2025-08-20 19:12:09 +01:00
Ben Hardill b7cef0bce7
Update packages/node_modules/@node-red/nodes/core/sequence/17-split.js 2025-08-20 18:45:26 +01:00
Ben Hardill 22a3f47060
Speed up split node
fixes #5251

The code changed from 4.0.x to 4.1.x

This change to to prevent making changes to the orginial input `msg`
object incase any values were stored in context (pass by refernce).

The change meant that for every output message the whole original
input `msg` was being cloned, which could be huge, causing a big
performance regresion.

This fix ensures the clone of the orginial `msg` is only done once
and the much smaller output message is then cloned again to update
`msg.parts` object for each output. This results in lots of small
clones rather than lots of very large clones.
2025-08-20 18:40:19 +01:00
Kazuhito Yokoi f70770a63d Show requesting status correctly in http request node when multiple processes are working 2025-08-03 14:23:23 +09:00
Debadutta Panda f57d7d9382 Improve raw body parser to handle skipped parsing and ended streams 2025-07-26 02:44:31 +05:30
Nick O'Leary 412f4465c7
Merge branch 'master' into dev 2025-07-21 16:29:52 +01:00
ZJ van de Weg 1eb6056843 Fix inject node validation to support binary and hexadecimal numbers
The inject node was using a restrictive regex that only accepted decimal
numbers, while the switch node properly supported binary (0b) and
hexadecimal (0x) formats. This inconsistency caused the inject node to
show validation errors for valid number formats.

Updated the inject node to use the same validateTypedProperty utility
function as the switch node, ensuring consistent number validation
across both nodes.

Fixes #5208
2025-07-07 16:19:34 +02:00
Nick O'Leary b364f8f9b6
Handle deprecated calls to child_process with args 2025-07-04 14:59:58 +01:00
Nick O'Leary 9bf9b7a635
Update context on autoComplete api 2025-06-26 14:30:13 +01:00
Nick O'Leary 0ae9f3dd8a
Add support for plugin sources of autoComplete fields 2025-06-26 14:21:21 +01:00
Nick O'Leary d505b2171f
Merge pull request #5168 from GogoVega/truncate-topic-debug
Truncate topic of debug message and add tooltip
2025-06-25 17:03:04 +01:00
Nick O'Leary 03cd5f8588
Merge branch 'dev' into truncate-topic-debug 2025-06-25 16:30:41 +01:00
Nick O'Leary 7c9e2c41ba
Update packages/node_modules/@node-red/nodes/core/common/lib/debug/debug-utils.js 2025-06-25 16:30:33 +01:00
Nick O'Leary b428e24ea5
Update skip http body parser 2025-06-25 16:28:30 +01:00
Debadutta Panda af1f8bd112
Merge branch 'dev' into @feature/issue-5029 2025-06-21 19:41:03 +05:30
Nick O'Leary 3222efb5d0
Merge pull request #5172 from hardillb/http-request-rejectunauthorized-string
Allow limited Strings for msg.rejectUnauthorized
2025-06-16 14:04:43 +01:00
Ben Hardill 410e5b8faf
Allow limited Strings for msg.rejectUnauthorized
fixes #5171

If `msg.rejectUnauthorized` is a string allow "true", "false"
(and upper case versions) otherwise show a warning and use default
behaviour.

Boolean values used as is, any other types also ignored.
2025-06-13 13:33:42 +01:00
GogoVega 8449ba9a3c
Truncate topic of debug message and add tooltip 2025-06-11 15:48:03 +02:00
Ben Hardill 05b15e4d1a
Include URL query params in HTTP Digest
fixes #3616
2025-06-10 10:10:46 +01:00
Debadutta Panda f9241de213
Merge branch 'dev' into @feature/issue-5029 2025-06-10 13:06:13 +05:30
Nick O'Leary 5511b27855
Merge branch 'master' into dev 2025-06-09 10:51:35 +01:00
Debadutta Panda 9b3246075d
Update 21-httpin.js
- change the function name
- remove and change some functions description
2025-06-07 11:30:02 +05:30
Debadutta Panda 7d16feff24
Merge branch 'dev' into @feature/issue-5029 2025-06-07 10:47:20 +05:30
Nick O'Leary 56df614b38
Merge pull request #5159 from node-red/4927-function-globals
Add URL/URLSearchParams to Function sandbox
2025-06-06 16:27:51 +01:00
Nick O'Leary d5c7514668
Add URL/URLSearchParams to Function sandbox
Closes #4927
2025-06-06 16:21:04 +01:00