From 9d4de4b2955112a4a28cc8b95862886508af9f54 Mon Sep 17 00:00:00 2001 From: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com> Date: Wed, 2 Mar 2022 22:18:14 +0400 Subject: [PATCH] core: correctly set "yes to migrations" in agent config (#393) --- src/Simplex/Chat/Mobile.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Simplex/Chat/Mobile.hs b/src/Simplex/Chat/Mobile.hs index 8b829241ab..be007c19e3 100644 --- a/src/Simplex/Chat/Mobile.hs +++ b/src/Simplex/Chat/Mobile.hs @@ -20,6 +20,7 @@ import Simplex.Chat.Controller import Simplex.Chat.Options import Simplex.Chat.Store import Simplex.Chat.Types +import Simplex.Messaging.Agent.Env.SQLite (AgentConfig (yesToMigrations)) import Simplex.Messaging.Protocol (CorrId (..)) foreign export ccall "chat_init" cChatInit :: CString -> IO (StablePtr ChatController) @@ -57,7 +58,7 @@ defaultMobileConfig :: ChatConfig defaultMobileConfig = defaultChatConfig { yesToMigrations = True, - agentConfig = agentConfig defaultChatConfig {yesToMigrations = True} + agentConfig = (agentConfig defaultChatConfig) {yesToMigrations = True} } type CJSONString = CString @@ -68,7 +69,7 @@ getActiveUser_ st = find activeUser <$> getUsers st chatInit :: String -> IO ChatController chatInit dbFilePrefix = do let f = chatStoreFile dbFilePrefix - chatStore <- createStore f (dbPoolSize defaultMobileConfig) (yesToMigrations defaultMobileConfig) + chatStore <- createStore f (dbPoolSize defaultMobileConfig) (yesToMigrations (defaultMobileConfig :: ChatConfig)) user_ <- getActiveUser_ chatStore newChatController chatStore user_ defaultMobileConfig mobileChatOpts {dbFilePrefix} (const $ pure ())