From 4175bc50047afbba86958355da4d481245c39964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?He=CC=84sperus?= Date: Tue, 25 Aug 2026 00:55:03 +0800 Subject: [PATCH] fix(core): fix optimization wrapper dropping recursive mkdir --- manifest.json | 2 +- modules.json | 2 +- packages/gdrive/src/gdrive/fs.ts | 2 +- packages/plugin/CHANGELOG.md | 10 ++++++++++ packages/plugin/package.json | 2 +- packages/plugin/src/fs/wrappers/optimization.ts | 4 ++-- versions.json | 3 ++- 7 files changed, 18 insertions(+), 7 deletions(-) diff --git a/manifest.json b/manifest.json index a8ddd776..a20e2833 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "sync-engine", "name": "Sync Engine", - "version": "3.1.1", + "version": "3.1.2", "minAppVersion": "1.13.0", "authorUrl": "https://hesprs.github.io", "description": "The next-generation syncing plugin: Fast · Free · Extend with Modules. Supports WebDAV, S3, and Google Drive.", diff --git a/modules.json b/modules.json index 475de5a5..714c7d13 100644 --- a/modules.json +++ b/modules.json @@ -65,7 +65,7 @@ { "id": "gdrive", "name": "Google Drive", - "version": "0.0.1", + "version": "0.0.2", "description": "[Alpha] Google Drive backend support.", "icon": "server", "main": "https://sync.consensia.cc/modules/gdrive.js", diff --git a/packages/gdrive/src/gdrive/fs.ts b/packages/gdrive/src/gdrive/fs.ts index d1753130..a647ae2a 100644 --- a/packages/gdrive/src/gdrive/fs.ts +++ b/packages/gdrive/src/gdrive/fs.ts @@ -257,7 +257,7 @@ export default class GdriveFs implements RootFs { async mkdir(key: string, recursive: boolean): Promise { const parent = dirname(key); let parentId = this.resolveId(parent); - if (!parent && recursive) { + if (!parentId && recursive) { await this.mkdir(parent, true); parentId = this.resolveId(parent); } diff --git a/packages/plugin/CHANGELOG.md b/packages/plugin/CHANGELOG.md index 2f87ccf3..cea79a71 100644 --- a/packages/plugin/CHANGELOG.md +++ b/packages/plugin/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. +## Sync Engine v3.1.2 - 2026-08-24 + +### Core + +- Fixed first sync failure caused by nested base directory. + +### Google Drive Module + +- Fixed recursive folder creation fail to apply. + ## Sync Engine v3.1.1 - 2026-08-23 ### Core diff --git a/packages/plugin/package.json b/packages/plugin/package.json index 8926a84d..784e025d 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,6 +1,6 @@ { "name": "@hesprs/sync-engine-sdk", - "version": "3.1.1", + "version": "3.1.2", "description": "Official SDK for developing modules targeting Sync Engine, the extensible Obsidian syncing plugin.", "keywords": [ "obsidian-plugin", diff --git a/packages/plugin/src/fs/wrappers/optimization.ts b/packages/plugin/src/fs/wrappers/optimization.ts index e225752b..129dc6b7 100644 --- a/packages/plugin/src/fs/wrappers/optimization.ts +++ b/packages/plugin/src/fs/wrappers/optimization.ts @@ -215,8 +215,8 @@ class OptimizationCompanionFs implements WrappedFs { delete(key: string) { return this.original.delete(key); } - mkdir(key: string) { - return this.original.mkdir(key); + mkdir(key: string, recursive?: boolean) { + return this.original.mkdir(key, recursive); } stat(key: string) { return this.original.stat(key); diff --git a/versions.json b/versions.json index f3a6e382..2dfa98e0 100644 --- a/versions.json +++ b/versions.json @@ -7,5 +7,6 @@ "3.0.5": "1.12.3", "3.0.6": "1.12.3", "3.1.0": "1.13.0", - "3.1.1": "1.13.0" + "3.1.1": "1.13.0", + "3.1.2": "1.13.0" }