Closed qbeauperin closed 1 year ago
tested the issue and it seems to happen on AWS S3 as well
the issue is happening at exactly this line https://github.com/payloadcms/plugin-cloud-storage/blob/2f799a9420551b7999bc9f12f822fdb37042503b/src/hooks/beforeChange.ts#L18
No checking on the operation if it is an update to delete the old file
Hey @qbeauperin and @ahmedHusseinF — this is now fixed and will be released shortly! Thank you for the report!
Looking forward to it, thank you James! 🙌
Without the plugin, replacing a file with another will remove the old file(s). With it (I've only tested with the GCS adapter), they aren't, and the new files now exists alongside the old ones.
Additional weird behavior that popped up during testing:
image.jpg
a. image.jpg is now in the bucketimage.jpg
a. image is automatically renamedimage-1.jpg
b. bucket now has animage.jpg
AND animage-1.jpg
image.jpg
a. image is properly namedimage.jpg
again b. in the bucket,image.jpg
has been replaced with the newimage.jpg
, butimage-1.jpg
is still present