From db87c0b8e113330b774f494dbc0315f22c6fe4a0 Mon Sep 17 00:00:00 2001 From: Eddy Date: Sat, 2 May 2026 23:12:51 +0200 Subject: [PATCH] fix: MutexGuard vor .await droppen (Send-bound) [appimage] MutexGuard in eigenem Block isolieren damit er garantiert vor dem async .await gedroppt ist. Tauri-Commands muessen Send sein. Co-Authored-By: Claude Opus 4.6 --- src-tauri/src/context.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src-tauri/src/context.rs b/src-tauri/src/context.rs index d65640b..aa55389 100644 --- a/src-tauri/src/context.rs +++ b/src-tauri/src/context.rs @@ -768,20 +768,19 @@ pub async fn generate_briefing( } // 5. KB-Treffer zum Projekt (fehlertolerant) - { + let project_name = { let db = state.lock().unwrap(); - let project_name = db.get_active_session().ok().flatten() - .and_then(|s| s.title.split_whitespace().next().map(|w| w.to_string())); - drop(db); + db.get_active_session().ok().flatten() + .and_then(|s| s.title.split_whitespace().next().map(|w| w.to_string())) + }; // MutexGuard ist hier garantiert weg — vor dem .await - if let Some(ref proj) = project_name { - match crate::knowledge::search_knowledge_internal(proj, 3).await { - Ok(hints) if !hints.is_empty() => { - parts.push(hints); - sections.push("kb-hints".to_string()); - } - _ => {} + if let Some(ref proj) = project_name { + match crate::knowledge::search_knowledge_internal(proj, 3).await { + Ok(hints) if !hints.is_empty() => { + parts.push(hints); + sections.push("kb-hints".to_string()); } + _ => {} } }