it0/it0_app/lib/core/network
hailin 7b71a4f2fc fix: properly close WebSocket with subscription cancel + fire-and-forget
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>
2026-02-25 03:45:43 -08:00
..
api_result.dart Initial commit: IT0 AI-powered server cluster operations platform 2026-02-08 22:54:37 -08:00
connectivity_provider.dart feat: 生产级 API 错误处理 — 重试拦截器、友好错误提示、网络监测、WebSocket 退避 2026-02-23 04:01:04 -08:00
dedup_interceptor.dart fix: 根治 Unhandled Exception — async void 拦截器 + 全局错误兜底 2026-02-23 04:37:39 -08:00
dio_client.dart fix: 根治 Unhandled Exception — async void 拦截器 + 全局错误兜底 2026-02-23 04:37:39 -08:00
error_log_interceptor.dart feat: 补齐大厂级网络层 — 401并发锁、请求去重、结构化错误日志 2026-02-23 04:05:53 -08:00
retry_interceptor.dart fix: 根治 Unhandled Exception — async void 拦截器 + 全局错误兜底 2026-02-23 04:37:39 -08:00
token_refresh_lock.dart feat: 补齐大厂级网络层 — 401并发锁、请求去重、结构化错误日志 2026-02-23 04:05:53 -08:00
websocket_client.dart fix: properly close WebSocket with subscription cancel + fire-and-forget 2026-02-25 03:45:43 -08:00