refactor(service)!: require the bundled epoch 3 service

This commit is contained in:
Tunglies
2026-12-04 16:46:16 +08:00
parent 112c5f0e13
commit 084f8d36a7
5 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -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() =>
+3 -4
View File
@@ -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(())
}