From 832d3c8d3dc9251574a8354cbb5784915d5efa50 Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Fri, 9 Oct 2026 18:06:14 -0400 Subject: [PATCH] Synchronize Folder: no threads on the web (review fix) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scan_with ran the import scan beside the photo checks in a thread scope on every target; on wasm32 a thread can't be spawned and Scope::spawn panics, so Synchronize Folder… crashed the web build. There the two run one after the other, like the other file work in the engine. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/sync.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/engine/src/sync.rs b/crates/engine/src/sync.rs index dd2b6b9b5..3803abd81 100644 --- a/crates/engine/src/sync.rs +++ b/crates/engine/src/sync.rs @@ -137,6 +137,10 @@ impl SyncInput { /// library's photos, which run on several threads too. Stops early when `progress.cancel` is set. pub fn scan_with(input: SyncInput, progress: &ScanProgress) -> FolderChanges { let SyncInput { folder, revision, scan, photos, labels } = input; + // (no threads on the web: one after the other there) + #[cfg(target_arch = "wasm32")] + let (out, checks) = (crate::import::scan_with(scan, std::slice::from_ref(&folder), progress), check_photos(&photos, &labels, progress)); + #[cfg(not(target_arch = "wasm32"))] let (out, checks) = std::thread::scope(|sc| { let photos = &photos; let labels = &labels;