core: split group deletion into two transactions to prevent crashes on android (#865)

This commit is contained in:
JRoberts
2022-08-02 14:10:03 +04:00
committed by GitHub
parent 0b4a6cf9eb
commit 35eeac194e
2 changed files with 17 additions and 4 deletions
+3
View File
@@ -446,6 +446,9 @@ processChatCommand = \case
withChatLock . procCmd $ do
when (memberActive membership) . void $ sendGroupMessage gInfo members XGrpDel
mapM_ deleteMemberConnection members
-- two functions below are called in separate transactions to prevent crashes on android
-- (possibly, race condition on integrity check?)
withStore' $ \db -> deleteGroupConnectionsAndFiles db userId g
withStore' $ \db -> deleteGroup db user g
pure $ CRGroupDeletedUser gInfo
CTContactRequest -> pure $ chatCmdError "not supported"