From 39d74852ca473575a80f834f2c8f099278bf9994 Mon Sep 17 00:00:00 2001 From: Octopus Date: Thu, 23 Apr 2026 16:24:35 +0800 Subject: [PATCH] fix(storage): swap reversed sourceKey/targetKey args in OssStorageAdapter.copyObjectInSelfBucket (#6806) The ali-oss `copy(name, sourceName)` API expects the destination as the first argument and the source as the second. The previous implementation passed an encoded sourceKey as the destination and targetKey as the source, causing copy operations to attempt reading from the target path (which does not exist yet) and writing to the source path (overwriting the original). This bug caused custom plugin uploads to fail when using OSS storage, since the plugin file could not be moved from the temp path to its final location. Fixes #6787, #6648 Co-authored-by: octo-patch --- sdk/storage/src/adapters/oss.adapter.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sdk/storage/src/adapters/oss.adapter.ts b/sdk/storage/src/adapters/oss.adapter.ts index 1d98bd09e5..a73cf41f2e 100644 --- a/sdk/storage/src/adapters/oss.adapter.ts +++ b/sdk/storage/src/adapters/oss.adapter.ts @@ -341,12 +341,7 @@ export class OssStorageAdapter implements IStorage { async copyObjectInSelfBucket(params: CopyObjectParams): Promise { const { sourceKey, targetKey } = params; - const encodedSourceKey = sourceKey - .split('/') - .map((segment) => encodeURIComponent(segment)) - .join('/'); - - await this.client.copy(encodedSourceKey, targetKey); + await this.client.copy(targetKey, sourceKey); return { bucket: this.options.bucket,