The CopySource parameter to copy an S3 object requires the key name to be URL-encoded. The S3 copy job doesn't do this:
services/S3Client/S3Client.js:32-37
const command = new CopyObjectCommand({
CopySource: `${options.sourceBucket}/${options.sourceKey}`,
...
});
This means that any non URL-safe characters in object keys don't get correctly encoded, causing their copy to fail.
Fix: percent-encode each path segment individually (sourceKey.split("/").map(encodeURIComponent).join("/")), preserving literal / separators between folder levels — encodeURIComponent on the whole path would wrongly escape those as %2F too.
Reactions are currently unavailable
The CopySource parameter to copy an S3 object requires the key name to be URL-encoded. The S3 copy job doesn't do this:
This means that any non URL-safe characters in object keys don't get correctly encoded, causing their copy to fail.
Fix: percent-encode each path segment individually (sourceKey.split("/").map(encodeURIComponent).join("/")), preserving literal / separators between folder levels — encodeURIComponent on the whole path would wrongly escape those as %2F too.