From 1891b6bc7f386f3c91eac5cd16d2afa3cbf43482 Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 14:21:53 -0700 Subject: [PATCH 01/15] fix(scan): pre-arm scanning flag before publishing reindexed picker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `new_with_shared_state` published the new `FilePicker` to `SharedFilePicker` with `scanning=false` (the default) and only flipped it to `true` later inside `ScanJob::spawn`. Between those two events, any consumer that cloned the `signals.scanning` Arc — e.g. lua `wait_for_initial_scan` called right after `restart_index_in_path` reports the base_path swap — observed scanning=false and returned immediately, then ran a search on the freshly-initialized empty index. The race window is wide on Windows CI where filesystem walker startup takes longer; surfaced as `tests/programmatic_search_spec.lua:212` ("content_search switches indexed root before grepping") flaking on Windows e2e. Set `scanning=true` on the cloned signals Arc *before* publishing the picker, so any wait that observes the swap is guaranteed to also see scanning=true. `ScanJob::spawn` re-stores `true` so semantics are unchanged on the happy path. --- crates/fff-core/src/file_picker.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/fff-core/src/file_picker.rs b/crates/fff-core/src/file_picker.rs index ff91be56..b08fbf14 100644 --- a/crates/fff-core/src/file_picker.rs +++ b/crates/fff-core/src/file_picker.rs @@ -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); From 06b4efc2a0bc44e47a0554722ba6d0bf431e50b6 Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:23:15 -0700 Subject: [PATCH 02/15] ci: rerun 2/15 for windows e2e flake verification From 810ba609a9430395051c86e939aec51934eb38f6 Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:23:22 -0700 Subject: [PATCH 03/15] ci: rerun 3/15 for windows e2e flake verification From 47aa0016ce21235a99fd205eb420c1f8e6cbf54b Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:23:28 -0700 Subject: [PATCH 04/15] ci: rerun 4/15 for windows e2e flake verification From c499d7f48807aff41b9a5a4aedd6a9dfba976eba Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:23:33 -0700 Subject: [PATCH 05/15] ci: rerun 5/15 for windows e2e flake verification From 7eb0899e1ffc90823e8745d9183501951a3273d7 Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:23:38 -0700 Subject: [PATCH 06/15] ci: rerun 6/15 for windows e2e flake verification From 0cf1a62968489c82951017a2e9c8632e71eeadc5 Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:23:43 -0700 Subject: [PATCH 07/15] ci: rerun 7/15 for windows e2e flake verification From 42b9387fc084050c4d61941ca27993a933f1153f Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:23:49 -0700 Subject: [PATCH 08/15] ci: rerun 8/15 for windows e2e flake verification From ea4d00db8808adcc8839255937f79fbc35e77b4b Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:23:54 -0700 Subject: [PATCH 09/15] ci: rerun 9/15 for windows e2e flake verification From 01ba2ec9ad44a949faebc430351abac7c8bfa5bd Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:23:59 -0700 Subject: [PATCH 10/15] ci: rerun 10/15 for windows e2e flake verification From a46dd05bd09f6e24d5c24f06658df07e5f994d17 Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:24:05 -0700 Subject: [PATCH 11/15] ci: rerun 11/15 for windows e2e flake verification From 2422a56cc3baa49ee6935bfe885782a5f13d0c60 Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:24:10 -0700 Subject: [PATCH 12/15] ci: rerun 12/15 for windows e2e flake verification From 52c4870c86c347cfe7790726d0b0368524f923ce Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:24:15 -0700 Subject: [PATCH 13/15] ci: rerun 13/15 for windows e2e flake verification From 3637fadc294e860fab7cc0768da382cc6b3c81b1 Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:24:22 -0700 Subject: [PATCH 14/15] ci: rerun 14/15 for windows e2e flake verification From 8c70a9595b7bc3258ecf6d2028f994b63a71c18b Mon Sep 17 00:00:00 2001 From: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:24:27 -0700 Subject: [PATCH 15/15] ci: rerun 15/15 for windows e2e flake verification