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)
- Why no editableList is being used HOT 1
- Feature to disable and make page invisible or vice versa does not work properly HOT 2
- Allow multiple addressable outputs for "ui-template" node
- ui-link - theme undefined HOT 1
- Ui-Control behaviour upon Depoly HOT 1
- Property `class` not being updated when changing tabs HOT 7
- Hide disabled ui nodes HOT 9
- Create multiple dashboard instances HOT 1
- ui-switch does not update if a css class is injected with msg.class HOT 4
- Request for feature, Node red dashboard 2.0 "fill gauge from centre feature" .
- Add cache-control records to served files, particularly contrib ui node .m
- Add support for v-time-picker
- Investigate failing Cypress test on GH
- Merging multiple ui-base nodes
- If a custom widget is built in development mode then grid-row-end style is not present in the wrapper div
- UI Gauge - Improve icon sizing at varying sizes HOT 3
- ui-table ignores 'width' setting for type 'Link'
- Features for Forms Node HOT 2
- Fix group ordering
- Fix widget ordering
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.