From dbe657f997bf82a44201c41d0ad569f1e3ea523c Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Tue, 30 Jun 2026 17:17:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(client):=20=E8=87=AA=E5=8A=A8=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E5=88=B0=E5=B7=B2=E8=BF=90=E8=A1=8C=E9=9A=A7=E9=81=93?= =?UTF-8?q?=E6=97=B6=E5=BB=B6=E8=BF=9F=E6=98=BE=E7=A4=BA=20=E2=80=94=20?= =?UTF-8?q?=E2=80=94=E2=80=94=20=5FonStats=20=E5=9B=9E=E9=80=80=20effectiv?= =?UTF-8?q?eNode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 连接页延迟一直 —:自动连接/重连到「已在跑的隧道」时不走 _connect → _connectedNode 为 null → _onStats 提前 return,内核 urltest 实测(已确认到达 app:reality-out=579)无处回写 node.ping。与看门狗 _checkHealth/_probe 一致,回退到 effectiveNode(当前/智能所选节点)。 Co-Authored-By: Claude Opus 4.8 --- client/lib/state/connection_provider.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/lib/state/connection_provider.dart b/client/lib/state/connection_provider.dart index b633060..d8f2775 100644 --- a/client/lib/state/connection_provider.dart +++ b/client/lib/state/connection_provider.dart @@ -245,8 +245,10 @@ class ConnectionController extends StateNotifier { // 内核(经 REALITY 真实直连数据面)是唯一能实测的;回写到 node.ping → 连接页/节点列表同源。 void _onStats(VpnStatsEvent e) { if (state.phase != VpnPhase.on) return; - final node = _connectedNode; - if (node == null || node.uuid.isEmpty) return; + // 自动连接/重连到已在跑的隧道时不会走 _connect → _connectedNode 为 null;回退到 + // effectiveNode(当前/智能所选),否则 urltest 实测无处回写、连接页延迟一直显示 —。 + final Node node = _connectedNode ?? _ref.read(effectiveNodeProvider); + if (node.uuid.isEmpty) return; final ds = e.urltestResults.where((r) => r.delayMs > 0).map((r) => r.delayMs); if (ds.isEmpty) return; // urltest 成功:经 proxy 出站(REALITY 到节点)真实可达 → 记录时刻(供路径 A 判活)+ 回写延迟。