From 8f494fcc60dcbcf0e1a935e57d8b041a994bc43b Mon Sep 17 00:00:00 2001 From: cloudwithax Date: Mon, 16 Feb 2026 17:17:26 -0500 Subject: [PATCH] fix: prevent deadlock by releasing node_handle lock before requesting sync in join_community --- src-tauri/src/commands/community.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src-tauri/src/commands/community.rs b/src-tauri/src/commands/community.rs index d72d9c3..7f2d86b 100644 --- a/src-tauri/src/commands/community.rs +++ b/src-tauri/src/commands/community.rs @@ -272,6 +272,10 @@ pub async fn join_community( .await; } + // drop the node_handle lock before calling request_sync to avoid deadlock + // request_sync tries to acquire its own node_handle lock + drop(node_handle); + // request a snapshot now so joins work even when peers were already connected request_sync(&state).await;