mirror of
https://github.com/penpot/penpot.git
synced 2026-09-16 17:06:17 +00:00
* 🐛 Reject duplicate chunk index in chunked uploads Repeat uploads of the same chunk index each stored a new object because upload-chunk only checked index bounds. Run the handler in a transaction, lock the session row and reject an already-stored index with :duplicate-chunk-index. Also harden assemble-chunks to require exactly indices 0..n-1 so gaps or duplicates fail instead of assembling a corrupt file. Covers media, fonts and binfile through the shared helper. Closes #11634 AI-assisted-by: muse-spark-1.3-contributor * ✨ Cap upload chunk size at 30 MiB by default Chunks were only bounded by the 350 MiB HTTP body limit while the 30 MiB caps applied to the assembled file. Add :upload-max-chunk-size (default 30 MiB, tunable via env) and reject oversize chunks in upload-chunk with :validation/:chunk-too-large before anything is stored. App clients slice at 25/10 MiB, so no frontend change needed. AI-assisted-by: muse-spark-1.3-contributor * 🐛 Fix tx-run! call and storage resolve in upload-chunk Pass cfg as first arg to db/tx-run!, which expects [system f & params; without it every chunk upload raised invalid system/cfg provided and no chunk was stored, breaking assemble with missing-chunks. Also resolve storage without reuse-conn: put-object! writes to the backend outside any transaction, so reusing the tx connection gives no atomicity. Media, font and storage suites green, lint and format clean. AI-assisted-by: muse-spark-1.3-contributor