Closed
Description
Currently "_connecting" (parse_live_query.dart) is not properly handled properly.
This results in a state where the client can't establish a new connection to the server.
How to reproduce:
- connect to the livequery-server
- disconnect the client from the internet
- reconnect the client to the internet
- you won't be able to reconnect to to the livequery-server
(Tested on an android emulator)
The Problem:
- the IOWebSocketChannel crashes and calls onDone
- _userDisconnected is false => reconnect is called
- _connecting is set to true
- WebSocket.connect fails => catch called
reactivate wifi => onConnectivityChanged fires event
- reconnect is called
- BUT _connecting is still true => _connect is canceled
Similar problems occur when the server crashes.
(and at some other times? (not sure))
How to fix it:
My suggestion is:
- set _connecting to false in the catch block
- adding a timeout to WebSocket.connect (in case the server is down)
- set _connecting to false after WebSocket.connect is done
- remove "_connecting = false;" inside _handleMessage
- adding some kind of delayed reconnect inside the catch block (in _connect)
Any other ideas?
Metadata
Metadata
Assignees
Labels
No labels