-
Notifications
You must be signed in to change notification settings - Fork 52
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
Widget state not updated after network disconnection and recovery #620
Comments
I am still seeing this issue with version 1.8.0. The Connection Lost and Connection restored popups appear, and in the browser console I see
But the dashboard still does not interact with the server in either direction, as far as I can tell. |
Okay, I can now reliably reproduce this at least (a slightly different error, but I do now see the lack of interaction on the sockets) - investigating now |
So, this is a fun investigation. SocketIO deletes all custom event handlers when reconnecting, because our event handlers are run inside the I've asked https://stackoverflow.com/questions/78389767/reinstate-custom-event-handlers-after-socketio-re-connects which hopefully someone can assist with for my own understanding, but it seems a very odd architectural decision. |
Have you looked at how D1 handles this, or is the situation different? D1 successfully reconnects. |
@colinl I've managed to narrow this down to not being a SocketIO problem, but in fact a VueJS problem (and therefore Dashboard 1.0 doesn't help here unfortunately). More specifically, it's linked to how we're rendering our widgets. I've updated my SO question with the extra details if you're interested. |
Okay, I'm still no nearer to a solution, but a summary of the past 5 hours of debugging this:
|
I think I have a breakthrough... Looking at the SocketIO client source, I found: the To bypass this, we can pass Note, this still doesn't solve the problem for |
If the network connection with the browser fails, and then a widget state (eg ui-text node) is updated by sending it a message, then when the network recovers the new state is not reflected in the browser.
To replicate, import the flow below, or recreate it.
Run a browser showing the editor on the machine running node red and run a browser on another machine showing the dashboard.
Check that clicking the inject nodes updates the text in the browser showing the dashboard.
Disconnect the network from the machine showing the dashboard and wait for the connection error messages to appear in the developer console.
On the machine showing the editor click the other inject node.
Reconnect the network to the machine running the browser. The text shown in the dashboard does not update to show the new value. Refreshing the browser page does update it correctly.
With D1, running the equivalent test, the text does update to the new value automatically on network recovery.
Edit: I am still seeing this with dashboard version 1.8.0
The text was updated successfully, but these errors were encountered: