Current Behavior
this may be related to #909.
When the Node-red server is restarted (or after deploy/restart flows in the editor), the connection to all dashboard clients is terminated and then automatically restored. However, after the reconnect, the widget can receive new messages from the server node, but some of the widget notifications to the server node's onSocket listener may stop working.
Refreshing the client page solves the issue.
Expected Behavior
After socket connection restoration all widget-node communication (in both directions) should resume properly.
Steps To Reproduce
- Take a clean Dashboard 2.0 ui node, for example
ui-example
- Implement a widget-to-node notification mechanism, e.g.:
In widget:
this.$socket.emit('myCustomEvent'+this.id, this.id, msg)
In server node:
onSocket: {
['myCusomEvent'+node.id]: function (conn, id, msg) {console.log("Hello from "+conn)}
- Open 3 clients, verify that they all succeed in sending the above notification to the server node
- Restart the Node-red server process, or deploy/restart flows in the editor, wait for all clients to reconnect
- Try again to send notifications from all clients - usually some of them will fail (nothing arriving on server node)
Environment
- Dashboard version: 1.10.0
- Node-RED version: 3.1.9
- Node.js version: 20.10.0
- npm version: 10.2.3
- Platform/OS: Windows
- Browser: Chrome, Edge
Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate
Current Behavior
this may be related to #909.
When the Node-red server is restarted (or after deploy/restart flows in the editor), the connection to all dashboard clients is terminated and then automatically restored. However, after the reconnect, the widget can receive new messages from the server node, but some of the widget notifications to the server node's
onSocketlistener may stop working.Refreshing the client page solves the issue.
Expected Behavior
After socket connection restoration all widget-node communication (in both directions) should resume properly.
Steps To Reproduce
ui-exampleIn widget:
In server node:
Environment
Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate