-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packages / Cloudinary Storage: Fix move file when ROOT is defined #22551
Packages / Cloudinary Storage: Fix move file when ROOT is defined #22551
Conversation
🦋 Changeset detectedLatest commit: 75de80c The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Yeah, I was already looking into it and I just pushed new changes to fix the tests 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can confirm it fixes that specific issue 🚀
Although, I've noticed that the edited version of the image isn't actually persisted (regardless of ROOT
). However, this seems to be unrelated, as it was already the case before. Will open a separate issue 👍
I also have experienced this, but according to Cloudinary documentation, signed URLs are not invalidated https://arc.net/l/quote/rbyeysrn Since we are using signed URLs to access private assets, we could create a different file on Cloudinary instead of reusing the existent one, but the existent one is based on the primary key of the file so not sure if this is the right approach to follow. |
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Good catch, this seems to be exactly it! I've created #22556, let's discuss over there 👍 |
…2551) Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Scope
We are using Cloudinary as storage and we found that when using
STORAGE_<LOCATION>_ROOT
it throws an error when editing an image.It looks like the
move
operation does not take the root folder into consideration:https://github.com/directus/directus/blob/main/packages/storage-driver-cloudinary/src/index.ts#L199-L204
Although
delete
already handles this:https://github.com/directus/directus/blob/main/packages/storage-driver-cloudinary/src/index.ts#L365-L370
So in this PR we just apply the same approach in order to get the proper file path.
What's changed:
move
operation for Cloudinary storage. In other words, fix saving edited image when using ROOT with Cloudinary storagePotential Risks / Drawbacks
Review Notes / Questions