[bug]Early reconnect during the initial room connection
维护者通常 1 天内回复
@hiroshihorie 已经在做这个了。
开始于 2026年9月4日。
评估
这个 Issue 还没有评估数据。
描述
Describe the bug
During the initial room connection, the initial RTC WebSocket closes while Room.connect is still waiting for the PeerConnection to become connected. The SDK starts an automatic reconnect and opens a second RTC WebSocket approximately 170 ms later, while the original connection attempt is still pending. The original attempt eventually fails after approximately 10 seconds with MediaConnectException.
The two observed RTC WebSocket URLs were:
Initial connection:
wss://<host>/rtc?auto_subscribe=1&adaptive_stream=1&protocol=16&client_protocol=1&sdk=flutter&version=2.11.0&network=wifi&os=android&os_version=16&device_model=PJZ110
Reconnect attempt:
wss://<host>/rtc?auto_subscribe=1&adaptive_stream=1&reconnect=1&reconnect_reason=1&sid=PA_3HVH5rf53iDv&protocol=16&client_protocol=1&sdk=flutter&version=2.11.0&network=wifi&os=android&os_version=16&device_model=PJZ110
To Reproduce
- Use an Android 16 real device on Wi-Fi.
- Use
livekit_client2.11.0 and connect to a room. - Capture WebSocket traffic with Reqable.
- The issue was observed only during a specific period. During that period, approximately 1 in 5 connection attempts reproduced it. It was not reproduced before or after that period, including during other Reqable captures. The issue is not currently reproducible on demand.
- In a failing attempt, observe the initial RTC WebSocket without reconnect parameters, followed by a second RTC WebSocket containing
reconnect=1,reconnect_reason=1, andsidbefore the initial connection finishes. - The initial connection then fails with
MediaConnectExceptionafter approximately 10 seconds.
A minimal research test can force the same ordering by controlling the completion order of the WebSocket and PeerConnection operations. The main reproduction is covered by automatic reconnect starts while the initial Engine.connect still waits for PeerConnection; the trigger and key assertions are at lines 199-207.
Expected behavior
The initial room connection should finish successfully or fail before an automatic reconnect creates another RTC WebSocket. The initial connection and the automatic reconnect should not overlap within the same connection flow.
Platform information
- Flutter version: Flutter 3.38.10 (Dart 3.10.9)
- Plugin version:
livekit_client2.11.0 - Flutter target OS: Android, real device (PJZ110)
- Flutter target OS version: Android 16
- Flutter console log: The connection state reports
disconnectedwith reasonsignal; the original attempt later reportsMediaConnectException: Timed out waiting for PeerConnection to connect, please check your network for ice connectivity.
- 主要语言
- Dart
- 星标
- 421
- 派生
- 260
- 平均合并
- 2 天 11 小时
- 30 天内合并 PR
- 21
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
livekit/client-sdk-flutter 的其他 Issue
-
`jwtPayload.roomConfiguration` returns null fields for tokens from LiveKit server SDKs可能已有人在做 @RaphaelFakhri 于 11 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
livekit/client-sdk-flutter#1243 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 38/100
livekit/client-sdk-flutter#1265 ·
维护者通常 1 天内回复
-
A full reconnect that is in progress when disconnect() is called reopens the closed engine and retries up to reconnectAttempts可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 57/100
livekit/client-sdk-flutter#1245 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
livekit/client-sdk-flutter#1227 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
livekit/client-sdk-flutter#1221 · 1 条评论 ·
维护者通常 1 天内回复
查看 livekit/client-sdk-flutter 的全部 Issue
相似的 Issue
-
Push workflow fails: oversized artifacts cannot be pushed to `app` branch可能已有人在做 @marcnause 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
fossasia/magic-epaper-app#724 ·
维护者通常 1 天内回复
-
priority: high scope: frontend type: bug
难度 2/5 1-3 小时 新手友好度 65/100
GonsiorHack/czyPrzejade#15 ·
-
a: accessibility has reproducible steps p: cupertino_ui package team-design
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
fix: jaspr serve keyboard shortcuts (r/R/l/d/q) don't work on Windows可能已有人在做 @lewinpauli 今天认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 64/100
berkmancenter/frankly#729 ·
维护者通常 1 天内回复