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 @@ -712,6 +712,28 @@ return create_table(db, query, "message_store_local"); } +bool add_supports_auto_retry_column_to_p2p_messages_table(sqlite3 *db) { + char *error; + sqlite3_exec( + db, + "ALTER TABLE outbound_p2p_messages" + " ADD COLUMN supports_auto_retry INTEGER DEFAULT 0", + nullptr, + nullptr, + &error); + + if (!error) { + return true; + } + + std::ostringstream stringStream; + stringStream << "Error updating outbound_p2p_messages table: " << error; + Logger::log(stringStream.str()); + + sqlite3_free(error); + return false; +} + bool create_schema(sqlite3 *db) { char *error; sqlite3_exec( @@ -826,6 +848,7 @@ " plaintext TEXT NOT NULL," " ciphertext TEXT NOT NULL," " status TEXT NOT NULL," + " supports_auto_retry INTEGER DEFAULT 0," " PRIMARY KEY (message_id, device_id)" ");" @@ -1127,7 +1150,8 @@ {45, {recreate_outbound_p2p_messages_table, true}}, {46, {create_entries_table, true}}, {47, {create_message_store_local_table, true}}, - {48, {create_messages_idx_target_message_type_time, true}}}}; + {48, {create_messages_idx_target_message_type_time, true}}, + {49, {add_supports_auto_retry_column_to_p2p_messages_table, true}}}}; enum class MigrationResult { SUCCESS, FAILURE, NOT_APPLIED }; @@ -2570,12 +2594,14 @@ "attempt."); attempt_delete_file( tempBackupPath, - "Failed to delete temporary backup file from previous backup attempt."); + "Failed to delete temporary backup file from previous backup " + "attempt."); } if (file_exists(tempAttachmentsPath)) { Logger::log( - "Attempting to delete temporary attachments file from previous backup " + "Attempting to delete temporary attachments file from previous " + "backup " "attempt."); attempt_delete_file( tempAttachmentsPath, @@ -2626,7 +2652,8 @@ attempt_rename_file( tempBackupPath, finalBackupPath, - "Failed to rename complete temporary backup file to final backup file."); + "Failed to rename complete temporary backup file to final backup " + "file."); std::ofstream tempAttachmentsFile(tempAttachmentsPath); if (!tempAttachmentsFile.is_open()) { @@ -2721,7 +2748,8 @@ if (file_exists(plaintextBackupPath)) { attempt_delete_file( plaintextBackupPath, - "Failed to delete plaintext backup file from previous backup attempt."); + "Failed to delete plaintext backup file from previous backup " + "attempt."); } std::string plaintextMigrationDBQuery = "PRAGMA key = \"x'" + 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$@