From 1404a9f9d1b1324d57f80d00c3b07eb9b642e24a Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 14 Jul 2026 12:25:36 +0100 Subject: [PATCH] protondrive: fix incorrect modtime after uploading a file Update (which Put also uses) 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/protondrive/protondrive.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/protondrive/protondrive.go b/backend/protondrive/protondrive.go index 4595ea5dc..2cd6b1f42 100644 --- a/backend/protondrive/protondrive.go +++ b/backend/protondrive/protondrive.go @@ -1130,7 +1130,10 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op o.id = linkID o.originalSize = &fileSystemAttrs.Size - 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) o.blockSizes = fileSystemAttrs.BlockSizes o.digests = &sha1Hash