fix(client/macos): 启动即激活 sysext + command.sock 打点
旧 sysext(on-demand/常驻)会在 app 启动前自动重连,app 走 primeExistingConnection 而非 start() → 永不提交 OSSystemExtensionRequest → bundle 内的新版 sysext 永远装不上, 运行的还是旧版(无 CommandServer)→ command.sock 不存在 → StatsClient 断流(— KB/s + 旧延迟)。 - VpnChannel.register 阶段调 activateOnLaunch():同开发者高版本静默 replace 运行中的旧扩展。 - StatsClient 连接前打点 command.sock 路径与存在性,直接暴露「旧 sysext 没起 CommandServer」。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,14 @@ final class StatsClient: NSObject {
|
||||
NSLog("[pangolin/stats] LibboxNewCommandClient returned nil")
|
||||
return
|
||||
}
|
||||
// 打点:command.sock 由 sysext 的 LibboxCommandServer 在 group 容器内创建。
|
||||
// 若此处 sock 不存在 → 跑的是没起 CommandServer 的旧 sysext(版本没换上)。
|
||||
if let base = FileManager.default
|
||||
.containerURL(forSecurityApplicationGroupIdentifier: self.appGroup) {
|
||||
let sock = base.appendingPathComponent("command.sock").path
|
||||
let exists = FileManager.default.fileExists(atPath: sock)
|
||||
NSLog("[pangolin/stats] command.sock=%@ exists=%@", sock, exists ? "YES" : "NO(sysext 未起 CommandServer/旧版)")
|
||||
}
|
||||
for attempt in 0..<10 {
|
||||
do {
|
||||
try c.connect()
|
||||
|
||||
Reference in New Issue
Block a user