From 5cb8d0cd4ea5da883a12eb66014d39f1b0721ab7 Mon Sep 17 00:00:00 2001 From: Ruben Rosario Date: Sun, 21 Jun 2026 16:20:30 +0100 Subject: [PATCH] Fix update_task: always set updated_at to now() Local edits must always update updated_at to the current time. The task.updated_at field is only relevant for insert_task (API-synced tasks have a real server timestamp). --- src/infrastructure/db.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/infrastructure/db.rs b/src/infrastructure/db.rs index a33aa55..ba83541 100644 --- a/src/infrastructure/db.rs +++ b/src/infrastructure/db.rs @@ -183,9 +183,6 @@ impl Db { TaskStatus::Completed => "completed", TaskStatus::NeedsAction => "needsAction", }; - let updated_at = task - .updated_at - .unwrap_or_else(|| chrono::Utc::now().naive_utc()); let conn = self.conn.lock().unwrap(); conn.execute( "UPDATE tasks SET title=?1, notes=?2, status=?3, due=?4, position=?5, updated_at=?6 @@ -196,7 +193,7 @@ impl Db { status_str, due_str, task.position, - updated_at.format("%Y-%m-%d %H:%M:%S").to_string(), + chrono::Utc::now().format("%Y-%m-%d %H:%M:%S").to_string(), task.id, ], )?;