From dee6e23d34932c517de162314c96c9f1c503ae81 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 14 Jul 2026 12:13:56 +0100 Subject: [PATCH] putio: fix incorrect modtime after setting a file's modtime SetModTime kept the caller's full precision modtime in memory while the server stores second precision, so until the object was re-read the modtime did not match what a fresh listing would report. This broke wrappers which compare exact modtimes, such as the hasher backend's fingerprint and the VFS cache. Truncate the modtime to second precision to match what the server stores. --- backend/putio/object.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/putio/object.go b/backend/putio/object.go index 86edb008f..0f31f6f65 100644 --- a/backend/putio/object.go +++ b/backend/putio/object.go @@ -202,9 +202,12 @@ func (o *Object) SetModTime(ctx context.Context, modTime time.Time) (err error) if err != nil { return err } - o.modtime = modTime + // The server stores modtimes with second precision so truncate + // here too to keep the in-memory modtime identical to the one a + // fresh listing returns. + o.modtime = modTime.Truncate(time.Second) if o.file != nil { - o.file.UpdatedAt.Time = modTime + o.file.UpdatedAt.Time = o.modtime } return nil }