it0/it0_app/lib/core
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
..
audio feat: add WebSocket robustness to voice call (heartbeat, reconnect, jitter buffer) 2026-02-23 07:32:19 -08:00
config feat: 完成 iAgent App 三大功能 + 修复租户上下文 2026-02-23 01:10:52 -08:00
errors feat: 生产级 API 错误处理 — 重试拦截器、友好错误提示、网络监测、WebSocket 退避 2026-02-23 04:01:04 -08:00
network fix: properly close WebSocket with subscription cancel + fire-and-forget 2026-02-25 03:45:43 -08:00
router feat: 生产级 API 错误处理 — 重试拦截器、友好错误提示、网络监测、WebSocket 退避 2026-02-23 04:01:04 -08:00
services feat: 补齐大厂级网络层 — 401并发锁、请求去重、结构化错误日志 2026-02-23 04:05:53 -08:00
tenant Initial commit: IT0 AI-powered server cluster operations platform 2026-02-08 22:54:37 -08:00
theme style: 导航栏去掉蓝色药丸背景,改为图标/文字高亮 2026-02-23 05:09:34 -08:00
utils Initial commit: IT0 AI-powered server cluster operations platform 2026-02-08 22:54:37 -08:00
widgets feat: 生产级 API 错误处理 — 重试拦截器、友好错误提示、网络监测、WebSocket 退避 2026-02-23 04:01:04 -08:00