Open marc-legendre opened 3 months ago
Hi @marc-legendre , thanks for reporting the issue. I somewhat understand what the issue is, but I can't think of how to fix it off the top of my head. I'll try to take a look at this during the weekend, in the meantime if you want to raise a PR for the fix please feel free to do so!
Are you certain it's a bug?
Are you sure this is not an issue in noVNC?
Is there an existing issue for this?
Issue description
Hi there, I'm trying out this nice little project, and I noticed a small issue.
noVNC emits an error "Tried changing state of a disconnected RFB object" when VncScreen automatically tries to reconnect after a connection loss.
Details
It is an error to call
rfb.disconnect()
oncerfb
is in adisconnected
state.This happens when losing the connection to the server. Indeed, a call to
connect()
is scheduled without clearingrfb
orconnected
. Then whenconnect()
is called, it callsdisconnect()
, which callsrfb.disconnect()
.Note: noVNC emits an error, but handles the situation gracefully.
Clearing
rfb
prevents this from happening:Intuitively, I'd also clear
connected
. But I am not entirely sure if I getconnected
right, since it is initialized totrue
when autoconnect is enabled. I find this puzzling :thinking: