Skip to content

Progress ticker thread keeps running if a scan panics #45

Description

@Muawiya-contact

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersrustPull requests that update rust code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions