From 084f8d36a79f8bf76e9656c459d656e3d1c2d8ae Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Fri, 4 Dec 2026 16:46:16 +0800 Subject: [PATCH] refactor(service)!: require the bundled epoch 3 service --- Cargo.lock | 2 +- Cargo.toml | 2 +- Changelog.md | 1 + src-tauri/src/core/proxy_control.rs | 4 ++-- src-tauri/src/core/service.rs | 7 +++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3187395c..8b8f0d1e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1343,7 +1343,7 @@ dependencies = [ [[package]] name = "clash_verge_service_ipc" version = "2.8.3" -source = "git+https://github.com/clash-verge-rev/clash-verge-service-ipc.git?rev=0f21038d067ba360a3a94a480161feb1a3c26736#0f21038d067ba360a3a94a480161feb1a3c26736" +source = "git+https://github.com/clash-verge-rev/clash-verge-service-ipc.git?rev=ecb3a5ee63813df0cd1b44d2d99690bd635d4c92#ecb3a5ee63813df0cd1b44d2d99690bd635d4c92" dependencies = [ "anyhow", "kode-bridge", diff --git a/Cargo.toml b/Cargo.toml index 52190ae45..d57f0ff90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,7 @@ clash-verge-runtime-bundle = { path = "crates/clash-verge-runtime-bundle" } clash-verge-proxy-view = { path = "crates/clash-verge-proxy-view" } clash-verge-profile = { path = "crates/clash-verge-profile" } clash-verge-backup-archive = { path = "crates/clash-verge-backup-archive" } -clash_verge_service_ipc = { git = "https://github.com/clash-verge-rev/clash-verge-service-ipc.git", rev = "0f21038d067ba360a3a94a480161feb1a3c26736", version = "2.8.3", default-features = false } +clash_verge_service_ipc = { git = "https://github.com/clash-verge-rev/clash-verge-service-ipc.git", rev = "ecb3a5ee63813df0cd1b44d2d99690bd635d4c92", version = "2.8.3", default-features = false } tracing-estuary = { git = "https://github.com/Tunglies/tracing-estuary.git", branch = "main" } tauri-plugin-clash-verge-sysinfo = { path = "crates/tauri-plugin-clash-verge-sysinfo" } tracing = "0.1.44" diff --git a/Changelog.md b/Changelog.md index ddd551893..864062a63 100644 --- a/Changelog.md +++ b/Changelog.md @@ -23,6 +23,7 @@ GitHub, so they never reach users. --> ## v2.6.0 +- 使用 2.6.x 服务模式时请安装随附的服务,2.5.x 客户端无法使用新版服务 - **Mihomo 内核升级至 v1.19.34**
diff --git a/src-tauri/src/core/proxy_control.rs b/src-tauri/src/core/proxy_control.rs index 38befc063..34bf1df3c 100644 --- a/src-tauri/src/core/proxy_control.rs +++ b/src-tauri/src/core/proxy_control.rs @@ -390,10 +390,10 @@ fn service_proxy_config(verge: &IVerge, mixed_port: u16, pac_port: u16) -> Resul /// the write's, so it stays a failure. fn service_apply_result(requested: &MacosProxyConfig, outcome: ProxyApplyOutcome) -> Result<()> { match outcome { - ProxyApplyOutcome::Applied | ProxyApplyOutcome::NotRequested => Ok(()), + ProxyApplyOutcome::Applied => Ok(()), // Direct fallback satisfies a disable request. ProxyApplyOutcome::DirectFallback { .. } if matches!(requested, MacosProxyConfig::Disabled) => Ok(()), - // Older helpers encode a failed service lookup as fallback even when no OS write occurred. + // The service reports a missing network service as fallback before any OS write. #[cfg(target_os = "macos")] ProxyApplyOutcome::DirectFallback { message } if message == sysproxy::Error::NoActiveNetworkService.to_string() => diff --git a/src-tauri/src/core/service.rs b/src-tauri/src/core/service.rs index ef39be558..ea212127d 100644 --- a/src-tauri/src/core/service.rs +++ b/src-tauri/src/core/service.rs @@ -705,7 +705,6 @@ async fn start_with_existing_service( Ok::<_, anyhow::Error>(StartClashRequest { runtime: collect_service_runtime_bundle(config_file).await?, proposed_session_token: generate_service_session_token()?, - macos_proxy: None, }) }) .await?; @@ -763,9 +762,9 @@ async fn start_with_existing_service( } let result = response.data.context("Clash Verge Service 未返回会话信息")?; - tracing::Span::current().record("generation", result.session.generation); + tracing::Span::current().record("generation", result.generation); *ACTIVE_SERVICE_SESSION.lock() = Some(Arc::new(OwnerSessionProof { - generation: result.session.generation, + generation: result.generation, token: request.proposed_session_token.clone(), })); @@ -779,7 +778,7 @@ async fn start_with_existing_service( info, Type::Service, "服务成功启动核心 (session generation {})", - result.session.generation + result.generation ); Ok(()) }