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).
This commit is contained in:
@@ -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,
|
||||
],
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user