-
-
Notifications
You must be signed in to change notification settings - Fork 393
Offline users can get an infinite loop of reconnect attempts #2883
Copy link
Copy link
Open
Description
What is the problem?
If an offline user ever uses engine analysis they will open a socket. That will end up triggering this part of socket.dart
onStreamCancel: () {
if (_isDisposed) return;
// Schedule the socket to be closed if idle, after a short delay to
// avoid unnecessary reconnections.
_disposeTimers[route]?.cancel();
_disposeTimers[route] = Timer(idleTimeout, () {
_logger.fine('Disposing idle socket on $route.');
_pool[route]?.dispose();
_pool.remove(route);
// if during the idle time no new socket is requested, we reconnect
// the default socket
if (route == _currentRoute) {
_currentRoute = Uri(path: kDefaultSocketRoute);
if (!currentClient.isActive) {
currentClient.connect();
}
}
That will loop attempts to reconnect a websocket until the user goes online or closes the app.
Steps to reproduce the bug
Use engine analysis while offline.
App version
0.22.7
Device Info
Android emulator
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels