diff --git a/changelog.md b/changelog.md index ce5a0a3..f2775f9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2024-11-24 - 3.3.1 - fix(File) +Fixed issue with file restore metadata operations. + +- Corrected the order of operations in the file restore function to ensure custom metadata is appropriately deleted after moving the file. + ## 2024-11-24 - 3.3.0 - feat(core) Enhanced directory handling and file restoration from trash diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 6ac4176..f3325ad 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartbucket', - version: '3.3.0', + version: '3.3.1', description: 'A TypeScript library offering simple and cloud-agnostic object storage with advanced features like bucket creation, file and directory management, and data streaming.' } diff --git a/ts/classes.file.ts b/ts/classes.file.ts index 9b0425c..f3c2fa4 100644 --- a/ts/classes.file.ts +++ b/ts/classes.file.ts @@ -145,12 +145,16 @@ export class File { overwrite: false, ...optionsArg, }; - const moveToPath = optionsArg.toPath || (await (await this.getMetaData()).getCustomMetaData({ + const metadata = await this.getMetaData(); + const moveToPath = optionsArg.toPath || (await metadata.getCustomMetaData({ key: 'recycle' })).originalPath; + await metadata.deleteCustomMetaData({ + key: 'recycle' + }) await this.move({ path: moveToPath, - }) + }); } /**