From 819a48bd4b393544635b6d45269820d7478095b6 Mon Sep 17 00:00:00 2001 From: NimBold Date: Mon, 3 Aug 2026 17:08:27 +0330 Subject: [PATCH] fix(queue): order seed permit release before visibility - Keep a resumed seeder marked as starting until its download permit is released. - Prevent Linux scheduling from exposing an inconsistent seed lifecycle to observers. - Preserve the existing strict regression assertion. --- src-tauri/src/queue.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/queue.rs b/src-tauri/src/queue.rs index 576f307..b6e34cb 100644 --- a/src-tauri/src/queue.rs +++ b/src-tauri/src/queue.rs @@ -1194,9 +1194,12 @@ impl QueueManager { self.abandon_seed_start(&id); return; } - self.finish_seed_start(&id); self.record_seed_started(&id).await; + // Keep the lifecycle visibly in the starting state until its + // download permit has been released. Otherwise observers can + // see a resumed seeder before the permit transition finishes. self.release_download_permit_for_seed(&id).await; + self.finish_seed_start(&id); self.emit_state(&id, DownloadStatus::Seeding); } Ok(Aria2SeedControlOutcome::Complete) => {