fix(client): 自动连接到已运行隧道时延迟显示 — —— _onStats 回退 effectiveNode
连接页延迟一直 —:自动连接/重连到「已在跑的隧道」时不走 _connect → _connectedNode 为 null → _onStats 提前 return,内核 urltest 实测(已确认到达 app:reality-out=579)无处回写 node.ping。与看门狗 _checkHealth/_probe 一致,回退到 effectiveNode(当前/智能所选节点)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -245,8 +245,10 @@ class ConnectionController extends StateNotifier<ConnectionState> {
|
||||
// 内核(经 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 判活)+ 回写延迟。
|
||||
|
||||
Reference in New Issue
Block a user