Repository navigation
fix: upload processed client files from temp file for upload-thing storage - #19010
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
4181187 to
7008538
Compare
|
🚀 This is included in version v3.92.1 |
…s it for upload-thing storage (#19012) Stacked on #19010. Review and merge #19010 first. When Payload processed a direct-client upload, UploadThing stored the processed file under a new key. The original file from the browser stayed in storage, and nothing used it. Now the adapter deletes the original file when the processed file replaces it. ## Related work - Stack: #19010 → this PR - Issue: #18333 - #18921 fixed the same kind of extra file for Vercel Blob with `addRandomSuffix`.
Follow-up to #18388 for #18333. If Payload processed a direct-client upload, UploadThing could store a zero-byte file. The document still reported the processed file size. The adapter now uploads from the temporary file that holds the processed bytes, the same as Vercel Blob, GCS, and R2 after #18388.
file.bufferis empty.tempFilePathis present, the UploadThing adapter reads the bytes from that file.