diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp --- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp +++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp @@ -115,9 +115,14 @@ std::unique_ptr SQLiteQueryExecutor::getThread(std::string threadID) const { - static std::string getThreadByPrimaryKeySQL = + bool dataIsBackedUp = !threadIDMatchesKeyserverProtocol(threadID); + std::string threadsTable = dataIsBackedUp ? "backup_threads" : "threads"; + + std::string getThreadByPrimaryKeySQL = "SELECT * " - "FROM threads " + "FROM " + + threadsTable + + " " "WHERE id = ?;"; return getEntityByPrimaryKey( this->getConnection(), getThreadByPrimaryKeySQL, threadID); diff --git a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/ThreadOperationsUtilities/ThreadOperations.cpp b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/ThreadOperationsUtilities/ThreadOperations.cpp --- a/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/ThreadOperationsUtilities/ThreadOperations.cpp +++ b/native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/ThreadOperationsUtilities/ThreadOperations.cpp @@ -1,6 +1,7 @@ #include "ThreadOperations.h" #include "../../../DatabaseManagers/DatabaseManager.h" #include "Logger.h" +#include "ThreadTypeEnum.h" #include #include #include @@ -35,6 +36,7 @@ return; } - DatabaseManager::getQueryExecutor().replaceThread(*thread, false); + bool dataIsBackedUp = !threadIDMatchesKeyserverProtocol(threadID); + DatabaseManager::getQueryExecutor().replaceThread(*thread, dataIsBackedUp); } } // namespace comm diff --git a/web/shared-worker/_generated/comm_query_executor.wasm b/web/shared-worker/_generated/comm_query_executor.wasm index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc$@