From 8e1d43da430075d29c45c7110f942d32e1f34ac4 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Mon, 13 Apr 2026 08:50:34 -0500 Subject: [PATCH] fix: address critical AI review issues - Fix linuxdeploy AppImage extraction using --appimage-extract - Remove 'has no column named' from duplicate column error handling - Use strftime instead of datetime for created_at default format --- .docker/Dockerfile.linux-amd64 | 9 ++++++--- src-tauri/src/db/migrations.rs | 8 +++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.docker/Dockerfile.linux-amd64 b/.docker/Dockerfile.linux-amd64 index 6f9297ea..5c5892ef 100644 --- a/.docker/Dockerfile.linux-amd64 +++ b/.docker/Dockerfile.linux-amd64 @@ -26,9 +26,12 @@ RUN apt-get update -qq \ && rm -rf /var/lib/apt/lists/* # Install linuxdeploy for AppImage bundling (required for Tauri 2.x) -# Download linuxdeploy from the official repository and extract AppImage -RUN curl -fsSL -L https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -o /usr/local/bin/linuxdeploy \ - && chmod +x /usr/local/bin/linuxdeploy +# Download linuxdeploy AppImage and extract to get the binary +RUN curl -Ls https://github.com/tauri-apps/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -o /tmp/linuxdeploy.AppImage \ + && chmod +x /tmp/linuxdeploy.AppImage \ + && /tmp/linuxdeploy.AppImage --appimage-extract \ + && mv squashfs-root/usr/bin/linuxdeploy /usr/local/bin/ \ + && rm -rf /tmp/linuxdeploy.AppImage squashfs-root RUN rustup target add x86_64-unknown-linux-gnu \ && rustup component add rustfmt clippy diff --git a/src-tauri/src/db/migrations.rs b/src-tauri/src/db/migrations.rs index 4140eee5..12056f10 100644 --- a/src-tauri/src/db/migrations.rs +++ b/src-tauri/src/db/migrations.rs @@ -197,7 +197,7 @@ pub fn run_migrations(conn: &Connection) -> anyhow::Result<()> { ), ( "016_add_created_at", - "ALTER TABLE ai_providers ADD COLUMN created_at TEXT NOT NULL DEFAULT (datetime('now'))", + "ALTER TABLE ai_providers ADD COLUMN created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%d %H:%M:%S', 'now'))", ), ]; @@ -218,12 +218,10 @@ pub fn run_migrations(conn: &Connection) -> anyhow::Result<()> { || name.ends_with("_add_created_at") { // Use execute for ALTER TABLE (SQLite only allows one statement per command) - // Skip error if column already exists + // Skip error if column already exists (SQLITE_ERROR with "duplicate column name") if let Err(e) = conn.execute(sql, []) { let err_str = e.to_string(); - if err_str.contains("duplicate column name") - || err_str.contains("has no column named") - { + if err_str.contains("duplicate column name") { tracing::info!("Column may already exist, skipping migration {name}: {e}"); } else { return Err(e.into());