From 7eae25edd04a468da5a45cf028a6fa912a99ad2a Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Sun, 8 Sep 2024 17:55:04 +0900 Subject: [PATCH] - Fixed: - Case-insensitive file handling - Full-lower-case files are no longer created during database checking. - Bulk chunk transfer - The default value will automatically adjust to an acceptable size when using IBM Cloudant. --- src/lib | 2 +- src/main.ts | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/lib b/src/lib index c9af24e..633af44 160000 --- a/src/lib +++ b/src/lib @@ -1 +1 @@ -Subproject commit c9af24ecd6457f23e8fd3c454b7621a70742399b +Subproject commit 633af447d24339718d0f6e16e950a124b46b3896 diff --git a/src/main.ts b/src/main.ts index 614f25f..f6457a1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -688,6 +688,17 @@ ___However, to enable either of these changes, both remote and local databases n await this.performAppReload(); } + async migrateCheckBulkSize() { + if (this.settings.sendChunksBulk) { + if (this.settings.couchDB_URI != "" && isCloudantURI(this.settings.couchDB_URI)) { + if (this.settings.sendChunksBulkMaxSize > 1) { + Logger("Cloudant does not support bulk size more than 1MB, Automatically fixed", LOG_LEVEL_NOTICE); + this.settings.sendChunksBulkMaxSize = 1; + await this.saveSettings(); + } + } + } + } async migrationCheck() { const old = this.settings.settingVersion; const current = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE; @@ -2687,25 +2698,27 @@ Or if you are sure know what had been happened, we can unlock the database from const file = storageFileNameMap[storageFileNameCI2CS[e]]; if (!this.isFileSizeExceeded(file.stat.size)) { await this.updateIntoDB(file); - fireAndForget(() => this.checkAndApplySettingFromMarkdown(e, true)); + const path = getPathFromTFile(file); + fireAndForget(() => this.checkAndApplySettingFromMarkdown(path, true)); } else { Logger(`UPDATE DATABASE: ${e} has been skipped due to file size exceeding the limit`, logLevel); } })); initProcess.push(runAll("UPDATE STORAGE", filesExistOnlyInDatabase, async (e) => { const w = databaseFileNameMap[databaseFileNameCI2CS[e]]; + const path = getPath(w) ?? e; if (w && !(w.deleted || w._deleted)) { if (!this.isFileSizeExceeded(w.size)) { - await this.pullFile(e, undefined, false, undefined, false); + await this.pullFile(path, undefined, false, undefined, false); fireAndForget(() => this.checkAndApplySettingFromMarkdown(e, true)); - Logger(`Check or pull from db:${e} OK`); + Logger(`Check or pull from db:${path} OK`); } else { - Logger(`UPDATE STORAGE: ${e} has been skipped due to file size exceeding the limit`, logLevel); + Logger(`UPDATE STORAGE: ${path} has been skipped due to file size exceeding the limit`, logLevel); } } else if (w) { - Logger(`Deletion history skipped: ${e}`, LOG_LEVEL_VERBOSE); + Logger(`Deletion history skipped: ${path}`, LOG_LEVEL_VERBOSE); } else { - Logger(`entry not found: ${e}`); + Logger(`entry not found: ${path}`); } }));