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.
This commit is contained in:
NimBold
2026-08-03 17:08:27 +03:30
parent c4d3a2be51
commit 819a48bd4b
+4 -1
View File
@@ -1194,9 +1194,12 @@ impl<R: tauri::Runtime> QueueManager<R> {
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) => {