fix(storage-*): simplify key handling for signed urls and composite prefixes#16291
Merged
JarrodMFlesch merged 5 commits intomainfrom Apr 16, 2026
Merged
Conversation
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖 |
paulpopus
approved these changes
Apr 16, 2026
milamer
pushed a commit
to milamer/payload
that referenced
this pull request
Apr 20, 2026
…refixes (payloadcms#16291) ## Summary This PR primarily fixes inconsistent storage key and prefix behavior across adapters and client upload flows. The main goal is to make signed URL generation, object lookup/delete, and client upload path handling behave the same way for S3, GCS, Azure, R2, and Vercel Blob, especially when composite prefixes are enabled. ## Fixes This change fixes prefix/key mismatch issues by standardizing how adapters derive object keys, and resolves edge cases where client-uploaded files could diverge from server-side prefix/filename semantics. It also fixes GCS URL generation behavior by preserving canonical encoded public URLs instead of decoding them. ## Additional cleanup As part of the fix work, getFileKey was expanded to return normalized key components so adapters can consume one shared source of truth rather than rebuilding path logic in multiple places. This reduces duplication and makes future storage fixes safer. ## Validation Composite-prefix client upload coverage was added for Vercel Blob to protect the fixed behavior and prevent regressions in key/prefix handling.
Contributor
|
🚀 This is included in version v3.84.0 |
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.
Summary
This PR primarily fixes inconsistent storage key and prefix behavior across adapters and client upload flows. The main goal is to make signed URL generation, object lookup/delete, and client upload path handling behave the same way for S3, GCS, Azure, R2, and Vercel Blob, especially when composite prefixes are enabled.
Fixes
This change fixes prefix/key mismatch issues by standardizing how adapters derive object keys, and resolves edge cases where client-uploaded files could diverge from server-side prefix/filename semantics. It also fixes GCS URL generation behavior by preserving canonical encoded public URLs instead of decoding them.
Additional cleanup
As part of the fix work, getFileKey was expanded to return normalized key components so adapters can consume one shared source of truth rather than rebuilding path logic in multiple places. This reduces duplication and makes future storage fixes safer.
Validation
Composite-prefix client upload coverage was added for Vercel Blob to protect the fixed behavior and prevent regressions in key/prefix handling.