From aee96c9eac51609a720aab72f3d03084d247f700 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Tue, 17 Jun 2025 10:57:34 -0500 Subject: [PATCH] fix: set fileSize to full length instead of unread portion (#18409) `content.Len()` would return `0` bytes after a file was fully read. Since the buffer `Len` function returns the length of the unread portion. --- coderd/files/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coderd/files/cache.go b/coderd/files/cache.go index 484507d2ac..c3e2399d3b 100644 --- a/coderd/files/cache.go +++ b/coderd/files/cache.go @@ -35,7 +35,7 @@ func NewFromStore(store database.Store, registerer prometheus.Registerer, authz return CacheEntryValue{ Object: file.RBACObject(), FS: archivefs.FromTarReader(content), - Size: int64(content.Len()), + Size: int64(len(file.Data)), }, nil }