node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

'Widget load' event triggered only when there is data for the node in the Node-red datastore

Open omrid01 opened this issue 1 year ago • 0 comments

Current Behavior

Today, when a dashboard 2.0 widget stores its state in the Node-red datastore, when the widget loads (e.g. upon client open or refresh) it will receive a 'widget-load' notification, with a msg object holding the stored data. However, this message is triggered only if the datastore has any data of this node.

Expected Behavior

We need the event to be triggered unconditionally, with an empty msg in case the datastore had no data for the node. The rationale is that if there is no stored state for this widget, we may want to initialize it with some defaults, but while we get an event when there is data, we can never tell that there is no data available.

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 have provided an initial effort estimate

omrid01 avatar Apr 21 '24 12:04 omrid01