chore(client/macos): 清理延迟排查的诊断打点 + debug 注入(最终干净版)
延迟显示已修通。移除排查期的临时诊断:扩展侧 Log 客户端/klog 捕获、log.level=debug 注入、 diag 字段/setDiag;主 app StatsClient 每5帧的 dl/ul/urltest 打印;Dart 侧 [Stats]/[Ping] 打点。 保留全部修复:clash_api 注入取 urltest、sendProviderMessage 统计通道、/proxies history+active 缓存、共享广播流、_onStats 回退 effectiveNode、连接态跳过直连实测。 CURRENT_PROJECT_VERSION 52→53。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,6 @@ import '../services/api_config.dart';
|
||||
import '../services/latency_probe.dart';
|
||||
import 'auth_provider.dart';
|
||||
import 'connection_provider.dart';
|
||||
import '../bridge/log.dart';
|
||||
|
||||
// ── 节点列表 AsyncNotifier ────────────────────────────────────────
|
||||
|
||||
@@ -87,24 +86,14 @@ class NodesNotifier extends AsyncNotifier<List<Node>> {
|
||||
/// 回写某节点的实测延迟(ms)。连接态由 ConnectionController 用内核 urltest 回填连接节点,
|
||||
/// 让「连接页延迟」与「节点列表延迟」同源(都读 node.ping)、显示一致。ms<=0 忽略。
|
||||
void setLivePing(String uuid, int ms) {
|
||||
if (ms <= 0 || _disposed) {
|
||||
logLine('Ping', 'setLivePing SKIP ms=$ms disposed=$_disposed');
|
||||
return;
|
||||
}
|
||||
if (ms <= 0 || _disposed) return;
|
||||
final list = state.valueOrNull;
|
||||
if (list == null) {
|
||||
logLine('Ping', 'setLivePing no-list');
|
||||
return;
|
||||
}
|
||||
if (list == null) return;
|
||||
var changed = false;
|
||||
final updated = [
|
||||
for (final n in list)
|
||||
if (n.uuid == uuid && n.ping != ms) (() { changed = true; return n.copyWith(ping: ms); })() else n
|
||||
];
|
||||
final match = list.any((n) => n.uuid == uuid);
|
||||
logLine('Ping',
|
||||
'setLivePing ms=$ms match=$match changed=$changed '
|
||||
'nodes=[${list.map((n) => "${n.code}:${n.ping}").join(",")}]');
|
||||
if (changed) state = AsyncData(updated);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user