From 53205ab661700bdf7adb4552a443d2043264d5b0 Mon Sep 17 00:00:00 2001 From: Joe Lothan Date: Mon, 25 May 2026 23:56:13 -0400 Subject: [PATCH] bumped padding of bundles to 6 digits --- frontend/site.js | 2 +- pipeline/05_bundle_gen/bundle.go | 4 ++-- pipeline/05_bundle_gen/main.go | 2 +- pipeline/06_frontend/deploy.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/site.js b/frontend/site.js index 7126c13..8a8ef42 100644 --- a/frontend/site.js +++ b/frontend/site.js @@ -60,7 +60,7 @@ function pickBundle() { // Fetch a bundle JSON async function fetchBundle(idx) { - const padded = String(idx).padStart(4, "0"); + const padded = String(idx).padStart(6, "0"); const resp = await fetch(`tabs/${padded}.json`); if (!resp.ok) throw new Error(`Failed to fetch bundle ${padded}`); const data = await resp.json(); diff --git a/pipeline/05_bundle_gen/bundle.go b/pipeline/05_bundle_gen/bundle.go index 4692c8a..7d63310 100644 --- a/pipeline/05_bundle_gen/bundle.go +++ b/pipeline/05_bundle_gen/bundle.go @@ -74,11 +74,11 @@ func serializeBundle(entries []BundleEntry) ([]byte, error) { } func writeBundleLocal(outputDir string, index int, data []byte) error { - path := filepath.Join(outputDir, fmt.Sprintf("%04d.json", index)) + path := filepath.Join(outputDir, fmt.Sprintf("%06d.json", index)) return os.WriteFile(path, data, 0644) } func writeBundleS3(bucket string, index int, data []byte) error { - key := fmt.Sprintf("tabs/%04d.json", index) + key := fmt.Sprintf("tabs/%06d.json", index) return s3UploadBundle(bucket, key, data) } diff --git a/pipeline/05_bundle_gen/main.go b/pipeline/05_bundle_gen/main.go index 3fdb913..ac76140 100644 --- a/pipeline/05_bundle_gen/main.go +++ b/pipeline/05_bundle_gen/main.go @@ -237,7 +237,7 @@ func main() { fmt.Printf(" %d/%d bundles\n", n, estimatedTotal) } - logLine := fmt.Sprintf("bundle: %04d.json %dKB", job.index, len(job.data)/1024) + logLine := fmt.Sprintf("bundle: %06d.json %dKB", job.index, len(job.data)/1024) if logWriter != nil { logWriter.Write(logLine, false) } diff --git a/pipeline/06_frontend/deploy.sh b/pipeline/06_frontend/deploy.sh index 750db9a..4c21a9f 100755 --- a/pipeline/06_frontend/deploy.sh +++ b/pipeline/06_frontend/deploy.sh @@ -98,7 +98,7 @@ if [ "$OLD_TOTAL" -gt "$TOTAL_BUNDLES" ]; then STALE_COUNT=$((OLD_TOTAL - TOTAL_BUNDLES)) echo "Deleting $STALE_COUNT stale bundles ($TOTAL_BUNDLES to $((OLD_TOTAL - 1)))..." for i in $(seq "$TOTAL_BUNDLES" "$((OLD_TOTAL - 1))"); do - PADDED=$(printf "%04d" "$i") + PADDED=$(printf "%06d" "$i") aws s3 rm "s3://$SITE_BUCKET/tabs/${PADDED}.json" --quiet done echo "Deleted $STALE_COUNT stale bundles"