Project
vgrep
Description
When running in local mode (--local), the file watcher detects file modifications and deletes the old file entry from the database, but then only prints "(pending)" and never actually re-indexes the updated file. This causes modified files to disappear from search results permanently.
Error Message
N/A - No error is raised. The console shows:
[~] modified filename.rs (pending)
But no indexing occurs.
Debug Logs
$ RUST_LOG=debug vgrep --local watch
# Modify a file
[~] modified test.rs (pending)
# File is never re-indexed - no further output
System Information
vgrep version: 0.1.0
Mode: local (--local flag)
Screenshots
No response
Steps to Reproduce
- Run
vgrep --local watch in a project directory
- Wait for initial indexing to complete
- Modify an indexed source file (e.g., add a comment)
- Observe console shows
[~] modified filename.rs (pending)
- Run
vgrep "content from that file" in another terminal
- Observe the modified file no longer appears in search results
Expected Behavior
Modified files should be re-indexed immediately in local mode, just as they are in server mode. The file should remain searchable after modification.
Actual Behavior
The file is removed from the index (line 326-328 deletes the entry) but in local mode, the code only prints a message and returns without calling any indexing function. The file is permanently lost from the index until a full re-index is performed.
Additional Context
File: src/watcher.rs
Function: process_files() (lines 330-351)
Problematic code:
Mode::Local => {
println!(
" {} {} {} {}",
style("[~]").yellow(),
style("modified").yellow(),
style(filename).cyan(),
style("(pending)").dim() // <-- Never actually processed!
);
}
Fix direction: Add local indexing logic similar to index_file_server() for the Mode::Local branch:
Mode::Local => {
let engine = crate::core::EmbeddingEngine::new(&self.config)?;
self.index_file_local(&db, &engine, path, &content)?;
println!(" {} {} {}", style("[+]").green(), style("indexed").green(), style(filename).cyan());
}
Project
vgrep
Description
When running in local mode (
--local), the file watcher detects file modifications and deletes the old file entry from the database, but then only prints "(pending)" and never actually re-indexes the updated file. This causes modified files to disappear from search results permanently.Error Message
Debug Logs
System Information
vgrep version: 0.1.0 Mode: local (--local flag)Screenshots
No response
Steps to Reproduce
vgrep --localwatch in a project directory[~] modified filename.rs (pending)vgrep "content from that file"in another terminalExpected Behavior
Modified files should be re-indexed immediately in local mode, just as they are in server mode. The file should remain searchable after modification.
Actual Behavior
The file is removed from the index (line 326-328 deletes the entry) but in local mode, the code only prints a message and returns without calling any indexing function. The file is permanently lost from the index until a full re-index is performed.
Additional Context
File:
src/watcher.rsFunction:
process_files()(lines 330-351)Problematic code:
Fix direction: Add local indexing logic similar to
index_file_server()for theMode::Localbranch: