Skip to content

Commit 795e48b

Browse files
committed
Indexing: Fix overlay race during index rebuild
- Remove the initial `saving_entries` event from `mod.rs` that raced with the writer's `RebuildingIndex` event, overriding the phase back to "Saving entries... 0%" during the 20–30s `RecreateNameIndex` operation - Move `resetAggregation()` from scan-complete to scan-started so `index-scan-complete` doesn't clear the writer's in-progress phase - Update the rebuild hint from "Usually takes 2–3 minutes" to "Usually less than a minute" to match actual prod timing
1 parent 424eedb commit 795e48b

3 files changed

Lines changed: 2 additions & 14 deletions

File tree

apps/desktop/src-tauri/src/indexing/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -573,18 +573,6 @@ impl IndexManager {
573573
// InsertEntriesV2 batches from the channel.
574574
writer.set_expected_total_entries(summary.total_entries);
575575

576-
// Emit an initial saving_entries event so the UI shows
577-
// progress immediately (the writer may still be processing
578-
// a backlog of InsertEntriesV2 messages).
579-
let _ = app.emit(
580-
"index-aggregation-progress",
581-
serde_json::json!({
582-
"phase": "saving_entries",
583-
"current": 0,
584-
"total": summary.total_entries,
585-
}),
586-
);
587-
588576
// Flush the writer to ensure all scan batches are committed
589577
// before opening the read connection. Without this, the WAL
590578
// snapshot may not include the latest InsertEntriesV2 batches,

apps/desktop/src/lib/indexing/ScanStatusOverlay.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<div class="agg-content">
6565
<span class="scan-label">{aggLabel}</span>
6666
{#if aggPhase === 'rebuilding_index'}
67-
<span class="phase-hint">Usually takes 2–3 minutes</span>
67+
<span class="phase-hint">Usually less than a minute</span>
6868
{:else if showProgressBar}
6969
<div class="progress-row">
7070
<div

apps/desktop/src/lib/indexing/index-state.svelte.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export async function initIndexState(): Promise<void> {
9191
const unlistenStarted = await listen<{ volumeId: string }>('index-scan-started', () => {
9292
scanning = true
9393
resetCounters()
94+
resetAggregation()
9495
})
9596
unlistenHandles.push(unlistenStarted)
9697

@@ -113,7 +114,6 @@ export async function initIndexState(): Promise<void> {
113114
scanning = false
114115
entriesScanned = event.payload.totalEntries
115116
dirsFound = event.payload.totalDirs
116-
resetAggregation()
117117
})
118118
unlistenHandles.push(unlistenComplete)
119119

0 commit comments

Comments
 (0)