Merge pull request #1009 from GetStream/hotfix/reconnection
fix(llc): make ws reconnection more robust
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user