FlowFuse / FlowFuse/node-red-dashboard
Should widgets forward any properties received in messages
- Dominant language
- HTML
- Stars
- 355
- Forks
- 82
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 24
Description
### Current Behavior
Currently, depending on the widget, in case the widget received a message with any property that property also appears on the widget output upon dashboard action (for example `ui-button` and `ui-textInput` replay the last message changing only the payload, while `ui-form` creates a new message only containing the payload). For example, if I send a message `msg.test = 123` to a button, in the next button click the message from the button will have `msg.test = 123` included, in the case of the button this do not survive a page refresh or switching visible tabs.
This behaviour should be standardized, from what i can see in old DB1 the widgets did not store the incoming message to replay on output (only tested with button and textInput).
The behaviour of storing these properties (messages) to forward can be useful when wanting to use this to send other variables to other nodes without the need to use context store in node-red, but this causes some issues, especially with the "reserved properties" used to control the widgets, like `enabled`, `class`, `visible` and `ui_update`. These properties at least should be stripped of messages that the widget send, otherwise we may change another widget down the line by a setting we sent to another widget if the user never creates a new msg object or if it is directly connected to another dashboard widget.
For consistency (and even to reduce websocket / message overhead) would say that the behaviour DB1 has should be standardized across the widgets, the widget should only send `msg.payload` as well the other required properties (`msg._msgid`, `msg.topic`, `msg._client` and other deemed necessary for the management of the widgets / messages in Node-Red). If the widget is in passthrough mode in that scenario the output message should be the same as input when receiving a new input message, but in case of action (click) should only send the `msg.payload`.
### Expected Behavior
Widgets upon action should only send the relevant properties in most cases only `msg.payload` and `msg.topic`.
### Steps To Reproduce
_No response_
### Environment
- Dashboard version:
- Node-RED version:
- Node.js version:
- npm version:
- Platform/OS:
- Browser:
### Have you provided an initial effort estimate for this issue?
I am not a FlowFuse team member
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.