Store delivery and archive times without the monotonic reading (closes #529)
check / check (push) Waiting to run

finished_at, archived_at and the updated_at stamp a re-dispatch
writes came from a bare time.Now(). The SQLite driver stores a time
as time.Time.String(), which appends the monotonic clock reading
(" m=+…") to a time read from time.Now(). All three now come from
GORM's own clock, NowFunc(), which stamps created_at, so they are
stored in the same form. The tests for each write read the stored
text back.

Model: opus-5-5
This commit is contained in:
clawbot
2026-10-15 08:10:38 +00:00
parent 573f7f986a
commit dc5fa21bb8
6 changed files with 55 additions and 7 deletions
+5 -1
View File
@@ -277,7 +277,11 @@ func (w *archiveWriter) write(
}
}
row.ArchivedAt = time.Now()
// GORM's clock, the one that stamps created_at in the other
// databases, so this is stored in the same form. A bare time.Now()
// carries a monotonic clock reading, which the driver would store
// as an " m=+…" suffix.
row.ArchivedAt = w.db.NowFunc()
err := w.db.Create(&row).Error
if err != nil {