diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index a55603e437..eb69eae86c 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -2137,9 +2137,9 @@ withStore :: m a withStore action = asks chatStore - >>= runExceptT . action + -- >>= runExceptT . action -- use this line instead of above to log query errors - -- >>= (\st -> runExceptT $ action st `E.catch` \(e :: E.SomeException) -> liftIO (print e) >> E.throwIO e) + >>= (\st -> runExceptT $ action st `E.catch` \(e :: E.SomeException) -> liftIO (print e) >> E.throwIO e) >>= liftEither . first ChatErrorStore chatCommandP :: Parser ChatCommand diff --git a/src/Simplex/Chat/Store.hs b/src/Simplex/Chat/Store.hs index 39795d5b6d..3da0994e01 100644 --- a/src/Simplex/Chat/Store.hs +++ b/src/Simplex/Chat/Store.hs @@ -428,8 +428,10 @@ getContactGroupNames st userId Contact {contactId} = (userId, contactId) deleteContact :: MonadUnliftIO m => SQLiteStore -> UserId -> Contact -> m () -deleteContact st userId Contact {contactId, localDisplayName} = +deleteContact st userId Contact {contactId, localDisplayName} = do + liftIO $ putStrLn "in deleteContact, liftIO . withTransaction st $ \\db -> do" liftIO . withTransaction st $ \db -> do + liftIO $ putStrLn "DB.execute DELETE FROM connections WHERE connection_id IN ..." DB.execute db [sql| @@ -441,7 +443,9 @@ deleteContact st userId Contact {contactId, localDisplayName} = ) |] (userId, contactId) + liftIO $ putStrLn "DB.execute db \"DELETE FROM contacts WHERE user_id = ? AND contact_id = ?\" (userId, contactId)" DB.execute db "DELETE FROM contacts WHERE user_id = ? AND contact_id = ?" (userId, contactId) + liftIO $ putStrLn "DB.execute db \"DELETE FROM display_names WHERE user_id = ? AND local_display_name = ?\" (userId, localDisplayName)" DB.execute db "DELETE FROM display_names WHERE user_id = ? AND local_display_name = ?" (userId, localDisplayName) updateUserProfile :: StoreMonad m => SQLiteStore -> User -> Profile -> m ()