start_scan spawns a thread that emits scan-progress every 150ms and stops it after the scan finishes:
let result = tauri::async_runtime::spawn_blocking(move || { ... })
.await
.map_err(|e| e.to_string())?; // <- returns here on a panic
stop.store(true, Ordering::Relaxed);
let _ = ticker.join();
The ? is before the stop.store. If the blocking task panics (a rayon or jwalk worker dying on an odd filesystem, say), start_scan returns the join error and the ticker thread is left running for the rest of the process — still emitting progress events every 150ms behind the error state in the UI.
Setting stop before the ?, or wrapping the ticker in a guard that stops on drop, would cover it.
app/src-tauri/src/commands.rs:55
start_scanspawns a thread that emitsscan-progressevery 150ms and stops it after the scan finishes:The
?is before thestop.store. If the blocking task panics (a rayon or jwalk worker dying on an odd filesystem, say),start_scanreturns the join error and the ticker thread is left running for the rest of the process — still emitting progress events every 150ms behind the error state in the UI.Setting
stopbefore the?, or wrapping the ticker in a guard that stops on drop, would cover it.app/src-tauri/src/commands.rs:55