Merge pull request #1009 from GetStream/hotfix/reconnection

fix(llc): make ws reconnection more robust
This commit is contained in:
Salvatore Giordano
2022-03-15 16:17:23 +01:00
committed by GitHub
2 changed files with 12 additions and 3 deletions
+1
View File
@@ -2,6 +2,7 @@
🐞 Fixed
- Unread count specific to channel setting global unread count on a specific case.
- The reconnection logic for the ws is now more robust.
## 3.5.0
+11 -3
View File
@@ -190,8 +190,12 @@ class WebSocket with TimerHelper {
_connectionStatus = ConnectionStatus.connecting;
connectionCompleter = Completer<Event>();
final uri = await _buildUri();
_initWebSocketChannel(uri);
try {
final uri = await _buildUri();
_initWebSocketChannel(uri);
} catch (e, stk) {
_onConnectionError(e, stk);
}
return connectionCompleter!.future;
}
@@ -216,7 +220,11 @@ class WebSocket with TimerHelper {
Duration(milliseconds: delay),
() async {
final uri = await _buildUri(refreshToken: refreshToken);
_initWebSocketChannel(uri);
try {
_initWebSocketChannel(uri);
} catch (e, stk) {
_onConnectionError(e, stk);
}
},
);
}