Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui_button stores the msg sent to it. #1041

Open
SandeepAgarwal13 opened this issue Jun 28, 2024 · 2 comments
Open

ui_button stores the msg sent to it. #1041

SandeepAgarwal13 opened this issue Jun 28, 2024 · 2 comments
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do

Comments

@SandeepAgarwal13
Copy link

Current Behavior

When i send a message to to a ui_button - it stores the message.
(Irrespective of "if msg arrives on input, emulate a button click" option ).
I inject message with msg.X = , msg.Y=2 , msg.topic = 3.
I override the topic as part of button definition. Yet on button click in get msg.X=1,msg.Y=2.

Not clear why user message would be stored in the button. If there are multiple users it may create a situation of multiple messages being stored. (not sure).

This looks like potential memory leak.

Expected Behavior

In DB1 - ui_button doesnt store the msg.
In DB2 - as well - cannot see a reason why one would want ui_button node to store the msg sent to it.

Steps To Reproduce

No response

Environment

  • Dashboard version:1.12.2
  • Node-RED version: .3.1.9
  • Node.js version:20.10.0
  • npm version:10.2.3
  • Platform/OS:Windows
  • Browser:Chrome

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

@SandeepAgarwal13 SandeepAgarwal13 added bug Something isn't working needs-triage Needs looking at to decide what to do labels Jun 28, 2024
@colinl
Copy link
Contributor

colinl commented Jun 29, 2024

It is normally considered good practice in node red to pass through any message properties that are not relevant to the node. That allows users to pass additional data on to later nodes.
It will not cause a memory leak as only one message is retained irrespective of how many users you have.

It is unusual for this to cause any problems.

@SandeepAgarwal13
Copy link
Author

SandeepAgarwal13 commented Jul 1, 2024

@colinl - I have not checked if its happening also multiple users (i.e each user's message being stored). Irrespective i dont think its ok. Please see below example.

Say i have button "Refresh".

  1. I sent a message at 11:00 AM. This is passed ahead via. Refresh button node. (as "if msg arrives on input, emulate a button click" option is selected ). (The creation of msg is a result of some user action on Dashboard - say some other button or dropdown etc.)

  2. I click the Refresh button at 11:15 AM via. Dashboard. I am not expecting to see additional data other than what i click. But i see that the msg is enriched with the details of msg sent in Step 1.

  3. This is more problematic for multi user play. User 1 does Step 1.

  4. User 2 does Step 2 .

Now if its storing messages for every user - eventually i may run into a memory growing and crash scenario.
If only 1 msg is stored - then post Step 4 - the message will be stamped with attributes of Step 3 done by other another user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
None yet
Development

No branches or pull requests

2 participants