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
|
🐞 Fixed
|
||||||
- Unread count specific to channel setting global unread count on a specific case.
|
- 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
|
## 3.5.0
|
||||||
|
|
||||||
|
|||||||
@@ -190,8 +190,12 @@ class WebSocket with TimerHelper {
|
|||||||
_connectionStatus = ConnectionStatus.connecting;
|
_connectionStatus = ConnectionStatus.connecting;
|
||||||
connectionCompleter = Completer<Event>();
|
connectionCompleter = Completer<Event>();
|
||||||
|
|
||||||
final uri = await _buildUri();
|
try {
|
||||||
_initWebSocketChannel(uri);
|
final uri = await _buildUri();
|
||||||
|
_initWebSocketChannel(uri);
|
||||||
|
} catch (e, stk) {
|
||||||
|
_onConnectionError(e, stk);
|
||||||
|
}
|
||||||
|
|
||||||
return connectionCompleter!.future;
|
return connectionCompleter!.future;
|
||||||
}
|
}
|
||||||
@@ -216,7 +220,11 @@ class WebSocket with TimerHelper {
|
|||||||
Duration(milliseconds: delay),
|
Duration(milliseconds: delay),
|
||||||
() async {
|
() async {
|
||||||
final uri = await _buildUri(refreshToken: refreshToken);
|
final uri = await _buildUri(refreshToken: refreshToken);
|
||||||
_initWebSocketChannel(uri);
|
try {
|
||||||
|
_initWebSocketChannel(uri);
|
||||||
|
} catch (e, stk) {
|
||||||
|
_onConnectionError(e, stk);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user