From f62db5fe733b21e923fe685ebcda253ba6bb2fa3 Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Mon, 22 Jun 2026 12:14:48 +0900 Subject: [PATCH] WIP (pluginV2) --- src/features/ConfigSync/CmdConfigSync.ts | 12 +++++++----- src/features/HiddenFileSync/CmdHiddenFileSync.ts | 10 +++++++++- updates.md | 5 +++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/features/ConfigSync/CmdConfigSync.ts b/src/features/ConfigSync/CmdConfigSync.ts index 8fbd22e..7cd564b 100644 --- a/src/features/ConfigSync/CmdConfigSync.ts +++ b/src/features/ConfigSync/CmdConfigSync.ts @@ -1512,11 +1512,13 @@ export class ConfigSync extends LiveSyncCommands { if (stat && stat.type != "file") return false; const configDir = normalizePath(this.configDir); - const synchronisedInConfigSync = Object.values(this.settings.pluginSyncExtendedSetting) - .filter((e) => e.mode != MODE_SELECTIVE && e.mode != MODE_SHINY) - .map((e) => e.files) - .flat() - .map((e) => `${configDir}/${e}`.toLowerCase()); + const synchronisedInConfigSync = this.useV2 + ? [] + : Object.values(this.settings.pluginSyncExtendedSetting) + .filter((e) => e.mode != MODE_SELECTIVE && e.mode != MODE_SHINY) + .map((e) => e.files) + .flat() + .map((e) => `${configDir}/${e}`.toLowerCase()); if (synchronisedInConfigSync.some((e) => e.startsWith(path.toLowerCase()))) { this._log(`Customization file skipped: ${path}`, LOG_LEVEL_VERBOSE); // This file could be handled by the other module. diff --git a/src/features/HiddenFileSync/CmdHiddenFileSync.ts b/src/features/HiddenFileSync/CmdHiddenFileSync.ts index 6a36a67..23e0f5d 100644 --- a/src/features/HiddenFileSync/CmdHiddenFileSync.ts +++ b/src/features/HiddenFileSync/CmdHiddenFileSync.ts @@ -971,7 +971,8 @@ Offline Changed files: ${processFiles.length}`; getCustomisationSynchronizationIgnoredFiles(): string[] { const configDir = this.services.API.getSystemConfigDir(); const key = - JSON.stringify(this.settings.pluginSyncExtendedSetting) + `||${this.settings.usePluginSync}||${configDir}`; + JSON.stringify(this.settings.pluginSyncExtendedSetting) + + `||${this.settings.usePluginSync}||${this.settings.usePluginSyncV2}||${configDir}`; if (this.cacheCustomisationSyncIgnoredFiles.has(key)) { return this.cacheCustomisationSyncIgnoredFiles.get(key)!; } @@ -983,6 +984,13 @@ Offline Changed files: ${processFiles.length}`; .map((e) => e.files) .flat() .map((e) => `${configDir}/${e}`.toLowerCase()); + + if (this.settings.usePluginSyncV2) { + synchronisedInConfigSync.push(`${configDir}/plugins/`.toLowerCase()); + synchronisedInConfigSync.push(`${configDir}/themes/`.toLowerCase()); + synchronisedInConfigSync.push(`${configDir}/snippets/`.toLowerCase()); + } + this.cacheCustomisationSyncIgnoredFiles.set(key, synchronisedInConfigSync); return synchronisedInConfigSync; } diff --git a/updates.md b/updates.md index 2dee6d9..f87693c 100644 --- a/updates.md +++ b/updates.md @@ -3,6 +3,11 @@ Since 19th July, 2025 (beta1 in 0.25.0-beta1, 13th July, 2025) The head note of 0.25 is now in [updates_old.md](https://github.com/vrtmrz/obsidian-livesync/blob/main/updates_old.md). Because 0.25 got a lot of updates, thankfully, compatibility is kept and we do not need breaking changes! In other words, when get enough stabled. The next version will be v1.0.0. Even though it my hope. +## Unreleased +### Fixing (Not tested yet) + +- Fixed an issue where the database encounters a permanent reading conflict and endless looping when both `usePluginSyncV2` and `syncInternalFiles` targeting `.obsidian/plugins/` are enabled. Plugin Sync V2 now correctly intercepts all plugin-related files across both the real-time file watcher and initial scans, preventing `HiddenFileSync` from duplicating operations. + ## 0.25.77 19th June, 2026