fix: preserve custom TUN fields and sync service provider caches

Limit GUI authority to saved TUN fields while preserving custom overrides.

Sync provider caches after service startup, reloads and updates.
Publish copies atomically with session, runtime and cache metadata checks.
This commit is contained in:
wonfen
2026-09-11 20:44:58 +08:00
parent 82d76113f2
commit bea03e1a09
13 changed files with 615 additions and 53 deletions
+14 -3
View File
@@ -1,7 +1,11 @@
use super::{CmdResult, proxy_aware_coded_error};
use crate::core::{
CoreManager,
service::{SERVICE_MANAGER, ServiceStatus},
use crate::{
constants::timing,
core::{
CoreManager,
manager::RunningMode,
service::{SERVICE_MANAGER, ServiceStatus, request_runtime_provider_sync},
},
};
async fn execute_service_operation_sync(status: ServiceStatus, error_code: &str) -> CmdResult {
@@ -52,3 +56,10 @@ pub async fn continue_with_sidecar() -> CmdResult {
.await
.map_err(|error| proxy_aware_coded_error(&error, "SERVICE_SIDECAR_FAILED"))
}
#[tauri::command]
pub fn sync_runtime_providers() {
if matches!(*CoreManager::global().get_running_mode(), RunningMode::Service) {
request_runtime_provider_sync(timing::RUNTIME_PROVIDER_SETTLE);
}
}