Root cause: IOWebSocketChannel.sink.close() can hang indefinitely (dart-lang/web_socket_channel#185). Previous fix used unawaited close but didn't cancel the stream subscription, so the old listener could still push events to _messageController. Fix: Extract _closeCurrentConnection() that: 1. Cancels StreamSubscription first (stops duplicate events immediately) 2. Fire-and-forget sink.close(goingAway) (frees underlying socket) This follows the workaround recommended in the official issue tracker. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api_result.dart | ||
| connectivity_provider.dart | ||
| dedup_interceptor.dart | ||
| dio_client.dart | ||
| error_log_interceptor.dart | ||
| retry_interceptor.dart | ||
| token_refresh_lock.dart | ||
| websocket_client.dart | ||