From 6500e1e5c44e994b862798ebc9862798012fde9c Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Sat, 5 Sep 2026 11:19:05 +0000 Subject: [PATCH] core: do not show chat relay test connections in chat list The connection created by APITestChatRelay has conn_type = contact and no chat entity, so the only thing keeping it out of the chat list was the filter on prepared status - and the agent event handler moves it past that status (CONF sets it to requested) before the relay test result arrives. So a relay test shows a phantom "connecting" chat while it runs, and permanently if the app is killed before the test deletes the connection. --- src/Simplex/Chat/Store/Messages.hs | 1 + src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/Simplex/Chat/Store/Messages.hs b/src/Simplex/Chat/Store/Messages.hs index 1cb90ab222..7e8b94e69b 100644 --- a/src/Simplex/Chat/Store/Messages.hs +++ b/src/Simplex/Chat/Store/Messages.hs @@ -1194,6 +1194,7 @@ getContactConnectionChatPreviews_ db User {userId} pagination clq = case clq of WHERE user_id = ? AND conn_type = ? AND conn_status != ? + AND relay_test = 0 AND contact_id IS NULL AND conn_level = 0 AND via_contact IS NULL diff --git a/src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt b/src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt index 7372e51b6b..15d57d5096 100644 --- a/src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt +++ b/src/Simplex/Chat/Store/SQLite/Migrations/chat_query_plans.txt @@ -2038,6 +2038,7 @@ Query: WHERE user_id = ? AND conn_type = ? AND conn_status != ? + AND relay_test = 0 AND contact_id IS NULL AND conn_level = 0 AND via_contact IS NULL @@ -2055,6 +2056,7 @@ Query: WHERE user_id = ? AND conn_type = ? AND conn_status != ? + AND relay_test = 0 AND contact_id IS NULL AND conn_level = 0 AND via_contact IS NULL @@ -2072,6 +2074,7 @@ Query: WHERE user_id = ? AND conn_type = ? AND conn_status != ? + AND relay_test = 0 AND contact_id IS NULL AND conn_level = 0 AND via_contact IS NULL