-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Bug Description
When beforeSend returns false, the emit('msg-input:' + widget.id, msg, wNode)
is still called unconditionally, sending false to the frontend via Socket.IO.
The comment in the code already acknowledges msg could be null if the beforeSend errors and returns null but the guard is only applied inside the else block,
not on the final emit.
Expected behavior
If beforeSend returns a falsy value, no msg-input event should be emitted
to the frontend.
Proposed fix
In nodes/config/ui_base.js, replace:
emit('msg-input:' + widget.id, msg, wNode)with:
if (msg) { emit('msg-input:' + widget.id, msg, wNode) }Use case
A custom widget that receives high-frequency data and processes it server-side
(e.g. forwarding to a UDP server) without any need to transfer data to the frontend.
Currently the only workaround is to throw an error from onInput, which generates
spurious [warn] messages in the Node-RED log.
Version
- node-red-dashboard: x.x.x
- Node-RED: x.x.x
Metadata
Metadata
Assignees
Labels
Type
Projects
Status