fix(site): drop the per-file asset size limit from the static manifest - #609
Conversation
buildAssetManifest is used only by deployStaticSite — the S3 arm, where assets go straight to storage by presigned PUT and never pass through our servers. There is no per-file ceiling to mirror: the python upload driver this arm replaces has none, so the 25 MiB check was a limit the other arm never had, and it turned any app with a large file in dist/ into a permanently failing publish once the flag caught it. Seen in prod at 10%: one app retried a 109 MB build artifact in dist/ every 1-3 minutes, 16 failures in an hour. The check was also the thing keeping whole-file reads safe, so hashing now streams: hashAssetFile updates the digest chunk by chunk, making peak memory one chunk instead of the file. The buffer form stays for callers that already hold the bytes, and a test pins the two to the same digest across a chunk boundary. Note the upload side still buffers a whole file per worker (uploadPresignedAsset -> readFile, MAX_UPLOAD_CONCURRENCY documents it), so peak memory there is concurrency x largest asset. Streaming that too needs a per-attempt stream, since a consumed stream cannot be replayed across the three upload retries — left as a follow-up rather than folded in here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G1E31AZvYBa86zpcYJFD1g
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.12-pr.609.cbdaa40Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.12-pr.609.cbdaa40"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.12-pr.609.cbdaa40"
}
}
Preview published to npm registry — try new features instantly! |
|
@claude fix the failing PR checks here |
|
Claude finished @netanelgilad's task in 3m 36s —— View job Failing checks fixed
What was failingTwo checks were red; Typecheck, Test, and Package Preview were already green. 1. Lint — Biome formatting. The new assertion in expect(manifest["/chunky.bin"].hash).toBe(
hashAsset("test-app-id", content),
);2. Knip — unused export:
Also cleaned up
Verification
The one test failure is |
- Format the chunked-hash assertion in site-manifest.spec.ts (Biome). - Stop exporting hashAssetFile; it is only used inside manifest.ts, and the unused export failed Knip. - Drop the now-stale "files over 25 MiB fail" sentence from docs/deployments.md. Co-authored-by: Netanel Gilad <3474905+netanelgilad@users.noreply.github.com>
Note
Description
Removes the 25 MiB per-file size limit that
buildAssetManifest()enforced on static assets. The limit existed because assets were read fully into memory viareadFile()before hashing; hashing now streams the file in chunks throughcreateReadStream(), so an asset is never held whole in memory at manifest time and there is no reason to reject large files. Deployments containing large assets (videos, WASM bundles, model files) no longer fail at manifest build.Related Issue
None
Type of Change
Changes Made
MAX_ASSET_SIZE_BYTESand theInvalidInputErrorthrown for oversized assets inpackages/cli/src/core/site/manifest.ts.hashAssetFile()helper that computes the same app-id-salted sha256 digest ashashAsset()but consumes the file as a read stream, so memory use is bounded by the chunk size rather than the file size.buildAssetManifest()stillstat()s each file for the manifestsizefield, but no longer reads its contents into aBuffer.docs/deployments.md: replaced the "files over 25 MiB fail with a per-file error" note with a statement that there is no per-file limit and that assets are hashed by streaming; the 100,000-file cap is unchanged.size, and added a test that a multi-chunk (200 KiB) file hashes to the same digest ashashAsset()over the whole buffer, guarding against chunk-boundary regressions.hashAssetFile()unexported (Knip flags unused exports) and formatted the new assertions per Biome.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The hash format is unchanged —
sha256(utf8(app_id) || raw file bytes)truncated to 32 hex chars — so previously deployed manifests and server-side dedup by hash remain valid. Upload of large assets is still subject to whatever limits the presigned-URL storage backend imposes; this change only removes the client-side manifest-time rejection.🤖 Generated by Claude | 2026-08-31 09:43 UTC | cbdaa40