quatrix: fix incorrect modtime after uploading a file

Update (which Put also uses) kept the caller's full precision modtime
in memory while the upload finalize request sends it rounded to
microseconds, 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. Round the modtime to microseconds to match what the
server stores.
This commit is contained in:
Nick Craig-Wood
2026-07-14 14:13:49 +01:00
parent 1404a9f9d1
commit 449397b8df
+4 -1
View File
@@ -1151,7 +1151,10 @@ func (o *Object) dynamicUpload(ctx context.Context, size int64, modTime time.Tim
}
o.size = size
o.modTime = modTime
// finalize sends the modtime rounded to microseconds so round
// here too to keep the in-memory modtime identical to the one a
// fresh listing returns.
o.modTime = modTime.Round(time.Microsecond)
return nil
}