Comments (7)
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
index-CUItCJGa.js:236 
GET http://owl.local:1880/dashboard/socket.io/?EIO=4&transport=polling&t=OyPSHxc net::ERR_ADDRESS_UNREACHABLE
index-CUItCJGa.js:244
SIO connect error: Error: xhr poll error
at Polling.onError (index-CUItCJGa.js:236:22311)
at Request.<anonymous> (index-CUItCJGa.js:236:25856)
at Emitter.emit (index-CUItCJGa.js:236:20532)
at Request.onError (index-CUItCJGa.js:236:27307)
at index-CUItCJGa.js:236:27070 undefined
index-CUItCJGa.js:244 SIO connected
But the dashboard still does not interact with the server in either direction, as far as I can tell.
from node-red-dashboard.
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
from node-red-dashboard.
So, this is a fun investigation.
SocketIO deletes all custom event handlers when reconnecting, because our event handlers are run inside the mounted()
, the refresh fixes it, but when a standard reconnect()
takes place, the socket has cleared all the custom event handlers, and then doesn't resurrect them automatically.
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.
from node-red-dashboard.
Have you looked at how D1 handles this, or is the situation different? D1 successfully reconnects.
from node-red-dashboard.
@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.
from node-red-dashboard.
Okay, I'm still no nearer to a solution, but a summary of the past 5 hours of debugging this:
- Running
socket.connect()
after asocket.on('disconnect')
event does resurrect event handlers and a connection successfully for all core nodes (except for template nodes) and does not work for custom nodes, but only if the client is the cause of the disconnect, if the server is killed and restarts, thesocket.connect()
is never successful - A solution to force a reconnect even when the server is killed is to instatiate a whole new SocketIO manager as part of the reconnect logic - this works in restoring the connection for all widget types, but then kills all custom, and widget-scoped event handlers (e.g.
on('msg-input')
, which we cannot restore. - There are also issues around how we're rendering a widget using
<component :is="" />
. This is meant to runmounted()
andunmounted()
when theis
component is modified/updated - it does not, which means our event handlers, contained insidemounted ()
are lost - Killing (and then reviving) the internet connection on a device that is running a Dashboard, results in SocketIO refusing to connect back to the server again until a full browser refresh takes place, or we delete our manager entirely and consequently clear all event handlers in our widgets.
from node-red-dashboard.
I think I have a breakthrough...
Looking at the SocketIO client source, I found:
the _reconnecting
variable was set as true when the server disconnected, or when internet was lost, meaning that SocketIO was trying to handle the reconnection, but, for whatever reason I couldn't decipher, was never able to resurrect it.
To bypass this, we can pass reconnection: false
to override the default behaviour (docs). Then, the _reconnecting
check always passes, and forces SocketIO to reconnect when we tell it to.
Note, this still doesn't solve the problem for ui-template
and custom nodes, that's all a different (to-be-resolved) Vue problem, but this will at least fix for core nodes.
from node-red-dashboard.
Related Issues (20)
- ui-form passing prepopulated and submit not clickable
- Chart widget - 2 y-axis's HOT 1
- UI Chart - Change config UI for multiple "Series" definitions HOT 1
- `ui-template` How to get a flow variable? HOT 5
- `ui-template` How to display ssh `journalctl -f` log? HOT 1
- How to use data tracker in third-party ui node HOT 6
- Removing ui-control node instance crash HOT 3
- UI Notification - Not positioning correctly HOT 1
- Documentation: Teleports example not working as suggested. HOT 2
- Mdi icon not appearing HOT 2
- Allow ui_update for output messages
- Theme: Compact View
- Inclusion of a zero sized template node in a group alters its size. HOT 4
- Try import Univer (Spreadsheet) HOT 2
- Add full content to Markdown-Node HOT 5
- Switch does not send topic out even it is set at ui HOT 1
- Show Dashboard 2.0 seems not to work with Nodered 4.0.2 [Menu > View > Dashboard 2.0] HOT 4
- Have "Dialog" group types
- Docs: Interactive Documentation/Dashboard HOT 1
- Input fields placeholder mis-aligned HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-red-dashboard.