From 5324f729a9241ccd0ef6fb2f41b5926b2c5edb24 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Sat, 7 Mar 2026 10:08:39 +0100 Subject: [PATCH] fix: scope qmd update/embed to current vault collection only Previously called 'qmd update' and 'qmd embed' without arguments, which updated all global qmd collections. If any other collection had a broken path, the entire indexing would fail. Now passes the vault name explicitly: qmd update qmd embed -c This makes reindex independent of other qmd collections on the system. --- src-tauri/src/indexing.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src-tauri/src/indexing.rs b/src-tauri/src/indexing.rs index d1bae136..67427186 100644 --- a/src-tauri/src/indexing.rs +++ b/src-tauri/src/indexing.rs @@ -464,7 +464,9 @@ where ensure_collection(vault_path)?; - // Phase 1: update (scan files) + let vault_name = vault_dir_name(vault_path); + + // Phase 1: update (scan files) — scoped to this vault's collection only on_progress(IndexingProgress { phase: "scanning".to_string(), current: 0, @@ -475,7 +477,7 @@ where let update_output = qmd .command() - .args(["update"]) + .args(["update", &vault_name]) .output() .map_err(|e| format!("qmd update failed: {e}"))?; @@ -504,7 +506,7 @@ where error: None, }); - // Phase 2: embed (generate vectors) + // Phase 2: embed (generate vectors) — scoped to this vault's collection only on_progress(IndexingProgress { phase: "embedding".to_string(), current: 0, @@ -515,7 +517,7 @@ where let embed_output = qmd .command() - .args(["embed"]) + .args(["embed", "-c", &vault_name]) .output() .map_err(|e| format!("qmd embed failed: {e}"))?; @@ -579,7 +581,7 @@ pub fn run_incremental_update(vault_path: &str) -> Result<(), String> { let output = qmd .command() - .args(["update"]) + .args(["update", &vault_name]) .output() .map_err(|e| format!("qmd incremental update failed: {e}"))?;