* fix(s3): Correctly handle file deletion with custom URL
When a custom URL is configured for an S3-compatible provider, the
application was failing to delete files from the remote bucket. This was
because the deletion logic incorrectly used the full pathname of the
custom URL as the S3 object key, instead of the object's actual key
within the bucket.
This commit modifies the `removeFileFromS3InMain` function to be aware
of the `customUrl` setting. If a custom URL is in use, the logic now
correctly strips the custom URL's prefix from the image URL to
derive the proper S3 object key before sending the `DeleteObject`
command.
* feat(debug): Add detailed logging to S3 deletion
This commit adds extensive console logging to the `removeFileFromS3InMain`
function in `src/main/utils/deleteFunc.ts`.
The purpose of this change is to debug an issue where file deletion
fails with a custom URL. These logs will capture the state of key
variables (configMap, imgUrl, customUrl, fileKey) and any errors
returned by the S3 client during the deletion process. This is a
temporary debugging measure.
* fix(s3): Correctly handle file deletion using urlPrefix
This commit fixes a bug where file deletion from an S3-compatible
provider would fail if a custom URL was configured. The root cause was
that the logic was looking for a `customUrl` property in the config,
when the correct property name is `urlPrefix`.
The `removeFileFromS3InMain` function has been updated to use the
correct `urlPrefix` property. This ensures that when a custom URL
is present, the S3 object key is derived correctly by stripping the
prefix, allowing the deletion to succeed.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>