From 6e9ac6a9f916c1c20ecc2c1ede054159123cb7e2 Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Sat, 14 Feb 2026 15:21:00 +0900 Subject: [PATCH] - Application LifeCycle has now started in Main, not ServiceHub. --- manifest.json | 2 +- package-lock.json | 4 +-- package.json | 2 +- src/lib | 2 +- src/main.ts | 7 ++++- .../essential/ModuleInitializerFile.ts | 4 +-- src/modules/essential/ModuleMigration.ts | 2 +- .../essentialObsidian/ModuleObsidianEvents.ts | 2 +- .../services/ObsidianAppLifecycleService.ts | 6 ---- updates.md | 29 ++++++++++++------- 10 files changed, 34 insertions(+), 26 deletions(-) diff --git a/manifest.json b/manifest.json index dbcefb4..795a095 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-livesync", "name": "Self-hosted LiveSync", - "version": "0.25.43-patched-1", + "version": "0.25.43-patched-2", "minAppVersion": "0.9.12", "description": "Community implementation of self-hosted livesync. Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.", "author": "vorotamoroz", diff --git a/package-lock.json b/package-lock.json index 3b8b0ce..2f52bcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "obsidian-livesync", - "version": "0.25.43-patched-1", + "version": "0.25.43-patched-2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "obsidian-livesync", - "version": "0.25.43-patched-1", + "version": "0.25.43-patched-2", "license": "MIT", "dependencies": { "@aws-sdk/client-s3": "^3.808.0", diff --git a/package.json b/package.json index 6f2c734..2362ec4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-livesync", - "version": "0.25.43-patched-1", + "version": "0.25.43-patched-2", "description": "Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.", "main": "main.js", "type": "module", diff --git a/src/lib b/src/lib index 532f25f..69e7a51 160000 --- a/src/lib +++ b/src/lib @@ -1 +1 @@ -Subproject commit 532f25f94784e46edd98438edee61a632ed53072 +Subproject commit 69e7a510f19c2aeea53d9862680c133fd9e37c70 diff --git a/src/main.ts b/src/main.ts index 936a8be..856914a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -205,8 +205,13 @@ export default class ObsidianLiveSyncPlugin syncStatus: "CLOSED" as DatabaseConnectingStatus, }); + private async _startUp() { + await this.services.appLifecycle.onLoad(); + const onReady = this.services.appLifecycle.onReady.bind(this.services.appLifecycle); + this.app.workspace.onLayoutReady(onReady); + } onload() { - void this.services.appLifecycle.onLoad(); + void this._startUp(); } async saveSettings() { await this.services.setting.saveSettingData(); diff --git a/src/modules/essential/ModuleInitializerFile.ts b/src/modules/essential/ModuleInitializerFile.ts index d170a01..ed6d661 100644 --- a/src/modules/essential/ModuleInitializerFile.ts +++ b/src/modules/essential/ModuleInitializerFile.ts @@ -78,7 +78,7 @@ export class ModuleInitializerFile extends AbstractModule { const _filesStorage = [] as typeof filesStorageSrc; for (const f of filesStorageSrc) { - if (await this.services.vault.isTargetFile(f.path, f != filesStorageSrc[0])) { + if (await this.services.vault.isTargetFile(f.path)) { _filesStorage.push(f); } } @@ -122,7 +122,7 @@ export class ModuleInitializerFile extends AbstractModule { ); const path = this.getPath(doc); - if (isValidPath(path) && (await this.services.vault.isTargetFile(path, true))) { + if (isValidPath(path) && (await this.services.vault.isTargetFile(path))) { if (!isMetaEntry(doc)) { this._log(`Invalid entry: ${path}`, LOG_LEVEL_INFO); continue; diff --git a/src/modules/essential/ModuleMigration.ts b/src/modules/essential/ModuleMigration.ts index 90aca81..e6c03df 100644 --- a/src/modules/essential/ModuleMigration.ts +++ b/src/modules/essential/ModuleMigration.ts @@ -133,7 +133,7 @@ export class ModuleMigration extends AbstractModule { if (!isValidPath(path)) { continue; } - if (!(await this.services.vault.isTargetFile(path, true))) { + if (!(await this.services.vault.isTargetFile(path))) { continue; } if (!isMetaEntry(metaDoc)) { diff --git a/src/modules/essentialObsidian/ModuleObsidianEvents.ts b/src/modules/essentialObsidian/ModuleObsidianEvents.ts index ccd2c74..7db93a2 100644 --- a/src/modules/essentialObsidian/ModuleObsidianEvents.ts +++ b/src/modules/essentialObsidian/ModuleObsidianEvents.ts @@ -69,7 +69,7 @@ export class ModuleObsidianEvents extends AbstractObsidianModule { //@ts-ignore window.CodeMirrorAdapter.commands.save = () => { //@ts-ignore - _this.app.commands.executeCommandById("editor:save-file"); + void _this.app.commands.executeCommandById("editor:save-file"); // _this.app.performCommand('editor:save-file'); }; } diff --git a/src/modules/services/ObsidianAppLifecycleService.ts b/src/modules/services/ObsidianAppLifecycleService.ts index 12d6ede..b751bcb 100644 --- a/src/modules/services/ObsidianAppLifecycleService.ts +++ b/src/modules/services/ObsidianAppLifecycleService.ts @@ -9,12 +9,6 @@ declare module "obsidian" { } // InjectableAppLifecycleService export class ObsidianAppLifecycleService extends AppLifecycleServiceBase { - constructor(context: T) { - super(context); - // The main entry point when Obsidian's workspace is ready - const onReady = this.onReady; - this.context.app.workspace.onLayoutReady(onReady); - } performRestart(): void { void this.context.plugin.app.commands.executeCommandById("app:reload"); } diff --git a/updates.md b/updates.md index b686c34..e7180b2 100644 --- a/updates.md +++ b/updates.md @@ -3,11 +3,21 @@ 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. +## 0.25.43-patched-2 + +14th February, 2026 + +### Fixed +- Application LifeCycle has now started in Main, not ServiceHub. + - Indeed, ServiceHub cannot be known other things in main have got ready, so it is quite natural to start the lifecycle in main. + ## 0.25.43-patched-1 13th February, 2026 -You know this is a patch version, is the beta-release practically? Do not worry about the following memos, as they are indeed freaking us out. I trust that you have thought this was too large; you're right. +**NOTE: Hidden File Sync and Customisation Sync may not work in this version.** + +Just a heads-up: this is a patch version, which is essentially a beta release. Do not worry about the following memos, as they are indeed freaking us out. I trust that you have thought this was too large; you're right. If this cannot be stable, I will revert to 0.24.43 and try again. @@ -16,23 +26,22 @@ If this cannot be stable, I will revert to 0.24.43 and try again. - Now resolving unexpected and inexplicable dependency order issues... - The function which is able to implement to the service is now moved to each service. - AppLifecycleService.performRestart -- VaultService.isTargetFile is now uses separated multiple checkers instead of a single function. +- VaultService.isTargetFile is now using multiple checkers instead of a single function. - This change allows better separation of concerns and easier extension in the future. - Application LifeCycle has now started in ServiceHub, not ObsidianMenuModule. - - - It was on a QUITE unexpected place..., isn't it? + - It was in a QUITE unexpected place..., isn't it? - Instead of, we should call `await this.services.appLifecycle.onReady()` in other platforms. - - As in browser platform, it will be called at `DOMContentLoaded` event. + - As in the browser platform, it will be called at `DOMContentLoaded` event. -- ModuleTargetFilter, which is responsible for parsing ignore files has been refined. - - This should be separated to a TargetFilter and a IgnoreFileFilter for better maintainability. +- ModuleTargetFilter, which is responsible for parsing ignore files, has been refined. + - This should be separated to a TargetFilter and an IgnoreFileFilter for better maintainability. - Using `API.addCommand` or some Obsidian API and shimmer APIs, Many modules have been refactored to be derived to AbstractModule from AbstractObsidianModule, to clarify the dependencies. (we should make `app` usage clearer...) -- Fixed initialising `storageAccess` too late in `FileAccessObsidian` module (I am still wonder why it worked before...). +- Fixed initialising `storageAccess` too late in `FileAccessObsidian` module (I am still wondering why it worked before...). - Remove some redundant overrides in modules. ### Planned -- Some services have ambiguous name, such as `Injectable`. These will be renamed in the future for better clarity. +- Some services have an ambiguous name, such as `Injectable`. These will be renamed in the future for better clarity. - Following properties of `ObsidianLiveSyncPlugin` should be initialised more explicitly: - property : where it is initialised currently - `localDatabase` : `ModuleLocalDatabaseObsidian` @@ -44,7 +53,7 @@ If this cannot be stable, I will revert to 0.24.43 and try again. - `fileHandler` : `ModuleFileHandler` - `rebuilder` : `ModuleRebuilder` - `kvDB`: `ModuleKeyValueDB` - - And I think that having feature in modules directly is not good for maintainability, these should be separated to some module (loader) and implementation (not only service, but also independent something). + - And I think that having a feature in modules directly is not good for maintainability, these should be separated to some module (loader) and implementation (not only service, but also independent something). - Plug-in statuses such as requestCount, responseCount... should be moved to a status service or somewhere for better separation of concerns. ## 0.25.43