core: support closing/re-opening store on chat stop/start (#3132)

* core: support closing/re-opening store on chat stop/start

* update .nix refs

* kotlin: types

* add test

* update simplexmq
This commit is contained in:
Evgeny Poberezkin
2023-09-27 15:26:03 +01:00
committed by GitHub
parent 8709ad6ff3
commit 3c7fc6b0ee
11 changed files with 69 additions and 31 deletions
+1 -1
View File
@@ -171,7 +171,7 @@ startTestChat_ db cfg opts user = do
stopTestChat :: TestCC -> IO ()
stopTestChat TestCC {chatController = cc, chatAsync, termAsync} = do
stopChatController cc
stopChatController cc False
uninterruptibleCancel termAsync
uninterruptibleCancel chatAsync
threadDelay 200000
+6 -1
View File
@@ -953,10 +953,15 @@ testDatabaseEncryption tmp = do
alice ##> "/_start"
alice <## "chat started"
testChatWorking alice bob
alice ##> "/_stop"
alice ##> "/_stop close"
alice <## "chat stopped"
alice ##> "/db key wrongkey nextkey"
alice <## "error encrypting database: wrong passphrase or invalid database file"
alice ##> "/_start key=mykey"
alice <## "chat started"
testChatWorking alice bob
alice ##> "/_stop close"
alice <## "chat stopped"
alice ##> "/db key mykey nextkey"
alice <## "ok"
alice ##> "/_db encryption {\"currentKey\":\"nextkey\",\"newKey\":\"anotherkey\"}"