Skip to content

fix(plugin-cloud-storage): preserve user-defined prefix.defaultValue#16523

Merged
AlessioGr merged 4 commits into
mainfrom
fix/azure-bug-2-defaultvalue-prefix
May 7, 2026
Merged

fix(plugin-cloud-storage): preserve user-defined prefix.defaultValue#16523
AlessioGr merged 4 commits into
mainfrom
fix/azure-bug-2-defaultvalue-prefix

Conversation

@AlessioGr

@AlessioGr AlessioGr commented May 6, 2026

Copy link
Copy Markdown
Member

If you defined your own defaultValue on the prefix field of an upload collection (e.g. () => crypto.randomUUID() for a per-document folder), the cloud-storage plugin silently overwrote it.

The fix is a one-line change: only fall back to the plugin's default when no user-defined defaultValue is present.


* should sanitize the filename (e.g. `duplicate-target-1.png`) so the
* browser PUT lands on a fresh blob instead of overwriting the existing one.
*/
it('sanitizes the filename when a duplicate already exists', async () => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moved this test from the non-client-uploads int.spec.ts. Not a new test

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

await payload.delete({ collection: mediaSlug, id: seedDoc.id })
})

it('preserves a user-defined prefix.defaultValue across the plugin', async () => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the new test

@AlessioGr AlessioGr enabled auto-merge (squash) May 6, 2026 23:05
paulpopus
paulpopus previously approved these changes May 6, 2026
@AlessioGr AlessioGr merged commit 069dcb7 into main May 7, 2026
325 of 328 checks passed
@AlessioGr AlessioGr deleted the fix/azure-bug-2-defaultvalue-prefix branch May 7, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants