Repository navigation
Conversation
Adds durable, resumable upload sessions for large files (64MB and above by default) backed by S3 multipart uploads. - payload: hidden `payload-upload-sessions` collection with create, list, instructions, intent, storage, complete and cancel endpoints; segment planning; atomic finalization lease; opportunistic sweep; per-user quota; filename reservation while a session is active - storage-s3: `segmented` upload-instructions capability using multipart upload, ListParts reconciliation and HeadObject verification - ui: upload coordinator that starts uploading on file select, lets Save wait or continue in the background, and recovers sessions after reload - storage-s3: `clientUploads` is now enabled by default - payload: upload instructions require client uploads or local storage - ui: toast action buttons meet the 24px target size and wrap on narrow viewports - translations for the new upload messages
- payload: treat a file saved only into a draft version as claimed, so cancel and sweep no longer delete it - payload: enforce filename reservations with a unique reservation key and start provider uploads under the session lease - payload: only check session reservations for collections with segmented uploads - ui: skip the leave-without-saving prompt only for the form whose save is waiting on an upload - ui: upload a file renamed after its upload started again under its new name - ui: mint a fresh file reference for every save - ui: pass the target document ID to the fallback session upload - ui: fail fast on permanent 4xx segment errors - ui: do not offer recovery for uploads another tab still holds - use object parameters for endpoint and S3 helpers
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
# Conflicts: # packages/ui/src/layouts/Root/RootProviders.tsx
Contributor
📦 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.
|
This was referenced Nov 4, 2026
r1tsuu
added a commit
that referenced
this pull request
Nov 16, 2026
### What? Resumable upload sessions for large files (64MB and above by default), backed by S3 multipart uploads. Sessions apply when `clientUploads` is enabled on the S3 adapter. ### Why? A large upload sent as a single request fails as a whole: one dropped connection means starting over. ### How? - **Sessions.** A hidden `payload-upload-sessions` collection tracks each upload. It is only added when an adapter supports segmented uploads. Default CRUD, GraphQL and Local API access are closed; session endpoints run collection access themselves. - **Adapter contract.** `uploadInstructions.segmented` is an optional, `@experimental` addition to the existing client-upload contract. Only `@payloadcms/storage-s3` implements it. - **Resuming.** Storage reports which parts it has (S3 `ListParts`), so only missing parts are re-sent and the browser never reads ETags. That means no CORS `ExposeHeaders` change. - **Completion.** Completion reuses the existing receipt and `getFileFromUploadInstructions` path, then the normal create or update. `_objectKey` plus a lease on the session row prevents duplicate documents, with no new field on user collections. - **Filenames.** A session reserves its filename until it finishes, is cancelled or expires. - **Cleanup.** Expired, cancelled and failed sessions are cleaned up opportunistically when sessions are created or listed. No job runner is needed. - **Admin.** Files above the threshold go through a session when the form is saved. Smaller files, and SVG/XML, keep today's path. The `/intent` endpoint is used by the follow-up Admin PR, which starts uploads when a file is picked and finishes saves in the background. Split out of #19076. --------- Co-authored-by: Nate Lentz <[email protected]>
r1tsuu
added a commit
that referenced
this pull request
Nov 16, 2026
### What? Large uploads in the Admin now start as soon as the file is picked, keep going while the user navigates, and resume after a reload. Before, the transfer waited for Save, and leaving or reloading the page lost it. Split out of #19076. ### How? - **`UploadSessions` provider** at the Admin root owns running uploads, so they survive client-side navigation. - **Start on select.** `FileManager` and `Upload` start a session for files at or above the threshold. Bulk upload still uploads on Save. - **Save during an upload.** The submitted data is stored on the session (`/intent`) and validated right away. The form submits when storage completes, or the provider finishes the save with `/complete` if the user left. - **Recovery.** A "Finish saving" toast for uploads that were never saved. After a reload, the user reselects the file and only missing parts are sent. Leaving with an unsaved upload shows a warning. - **Toasts.** Action buttons move to a second row and meet the 24px target size (WCAG 2.5.8). - **Translations.** 13 new `upload:` keys. Non-English strings are machine-translated and need native-speaker review. ### Accessibility - **Automated (WCAG 2.2 A/AA):** progress in a polite live region (4.1.3), dismissible progress toast (2.2.2), persistent action toasts (2.2.1), keyboard access with Alt+T (2.1.1), target size (2.5.8), name, role, value (4.1.2). axe: no violations. - **Still needs manual checks:** screen reader progress output, focus after a toast action (2.4.3), focus visibility (2.4.7), and unsaved fields lost on reload (3.3.7). ### Preview Upload bandwidth is throttled to 5 MB/s to simulate a slow connection. **Background save:** Save during the upload, then leave the form. https://github.com/user-attachments/assets/69d212d7-bd6e-48f2-9f08-bc7289792d91 **Resume after a reload:** reselect the file from the toast. Only the missing parts are sent. https://github.com/user-attachments/assets/032458af-5ab2-4bac-9455-afb748fba7fd --------- Co-authored-by: Nate Lentz <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Resumable upload sessions for large files (64MB and above by default), backed by S3 multipart uploads. Sessions apply when
clientUploadsis enabled on the S3 adapter.Why?
Large uploads fail with a single request, and a dropped connection or reload means starting over.
How?
payload-upload-sessionscollection tracks each upload. Storage confirms which parts arrived, so only missing parts are re-sent.Breaking changes