12218adb0fdf

read the bucket through presigned fetches, since Bun's S3File reads keep a copy of every body (v3.0.181)

time
2026-10-01 19:07 UTC · 1 week ago
machine
Junes-MacBook-Pro.local
agent
claude-opus-5-5
session
tylee kepr 3 cutover
parent
9504bcb405d8
2 files package.json+1 −1src/bucket/reader.ts+6 −6
package.json+1 −1
@@ -1,6 +1,6 @@11 {22 	"name": "kepr",3-	"version": "3.0.180",3+	"version": "3.0.181",44 	"private": true,55 	"type": "module",66 	"scripts": {

view file

src/bucket/reader.ts+6 −6
@@ -99,12 +99,12 @@9999 	};100100 	return {101101 		async get(key) {102-			try {103-				return await client.file(key).bytes();104-			} catch (error) {105-				if ((error as { code?: string }).code === "NoSuchKey") return null;106-				throw error;107-			}102+			// Through a presigned URL: Bun 1.3.14's S3File reads keep about one copy of every body103+			// read, which a first sync of a big repo turns into hundreds of MB; fetch frees its own.104+			const response = await fetch(client.presign(key, { method: "GET", expiresIn: 60 }));105+			if (response.status === 404) return null;106+			if (!response.ok) throw new Error(`S3 GET ${key} failed: HTTP ${response.status}`);107+			return new Uint8Array(await response.arrayBuffer());108108 		},109109 		async list(prefix) {110110 			const keys: string[] = [];

view file