Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions crates/fff-core/src/file_picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,16 @@ impl FilePicker {
let path = picker.base_path.clone();
let trace_span = picker.trace_span.clone();

// Pre-arm `scanning` BEFORE publishing the new picker. `ScanJob::spawn`
// also sets it, but that runs after this function returns; consumers
// (e.g. lua `wait_for_initial_scan` after `restart_index_in_path`)
// that grab the signal Arc between publish and spawn would otherwise
// observe scanning=false and skip the wait, racing the walker. The
// race is wide on Windows CI where notify is slow.
signals
.scanning
.store(true, std::sync::atomic::Ordering::Release);

{
let mut guard = shared_picker.write()?;
*guard = Some(picker);
Expand Down
Loading