From 0cae907de659b0856364e172fe7d2bf4ab9cb09e Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Sun, 1 Nov 2026 16:12:40 +0800 Subject: [PATCH] fix(config): wait for pending configuration writes Serialize Verge patches behind the active configuration writer so toggling the system proxy after TUN does not fail immediately on lock contention. CLose: #6613, #8481, #8357 --- src-tauri/src/feat/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/src/feat/config.rs b/src-tauri/src/feat/config.rs index 2a1fdbe6c..da19781bd 100644 --- a/src-tauri/src/feat/config.rs +++ b/src-tauri/src/feat/config.rs @@ -27,7 +27,7 @@ pub async fn patch_verge(patch: &IVerge, not_save_file: bool) -> Result<()> { /// Apply a patch without post-update reconciliation. pub(super) async fn apply_verge_patch(patch: &IVerge, not_save_file: bool) -> Result<()> { - let config_write = Config::try_lock_config_write()?; + let config_write = Config::lock_config_write().await; apply_verge_patch_locked(&config_write, patch, not_save_file).await }