fix: add is_saved tracking to prevent duplicate metadata saves

Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-16 14:32:40 -03:00
parent 4f05dbd61f
commit 6b2cb49881
2 changed files with 65 additions and 11 deletions

View File

@@ -213,8 +213,11 @@ fn process_input_stream(
for meta_plugin in meta_plugins.iter_mut() {
match meta_plugin.finalize() {
Ok(value) => {
if let Err(e) = meta_plugin.save_meta(conn, item_id, value) {
eprintln!("Warning: Failed to save meta value: {}", e);
// Only save non-empty values (empty means already saved)
if !value.is_empty() {
if let Err(e) = meta_plugin.save_meta(conn, item_id, value) {
eprintln!("Warning: Failed to save meta value: {}", e);
}
}
}
Err(e) => {