mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-03-27 20:25:17 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58845276e7 | ||
|
|
a2cc093a9e |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-livesync",
|
||||
"name": "Self-hosted LiveSync",
|
||||
"version": "0.25.11",
|
||||
"version": "0.25.12",
|
||||
"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",
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "obsidian-livesync",
|
||||
"version": "0.25.11",
|
||||
"version": "0.25.12",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "obsidian-livesync",
|
||||
"version": "0.25.11",
|
||||
"version": "0.25.12",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.808.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "obsidian-livesync",
|
||||
"version": "0.25.11",
|
||||
"version": "0.25.12",
|
||||
"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",
|
||||
|
||||
@@ -582,6 +582,11 @@ export default class ObsidianLiveSyncPlugin
|
||||
$everyBeforeReplicate(showMessage: boolean): Promise<boolean> {
|
||||
return InterceptiveEvery;
|
||||
}
|
||||
|
||||
$$canReplicate(showMessage: boolean = false): Promise<boolean> {
|
||||
throwShouldBeOverridden();
|
||||
}
|
||||
|
||||
$$replicate(showMessage: boolean = false): Promise<boolean | void> {
|
||||
throwShouldBeOverridden();
|
||||
}
|
||||
|
||||
@@ -173,17 +173,23 @@ Even if you choose to clean up, you will see this option again if you exit Obsid
|
||||
}
|
||||
});
|
||||
}
|
||||
async $$_replicate(showMessage: boolean = false): Promise<boolean | void> {
|
||||
//--?
|
||||
if (!this.core.$$isReady()) return;
|
||||
|
||||
async $$canReplicate(showMessage: boolean = false): Promise<boolean> {
|
||||
if (!this.core.$$isReady()) {
|
||||
Logger(`Not ready`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isLockAcquired("cleanup")) {
|
||||
Logger($msg("Replicator.Message.Cleaned"), LOG_LEVEL_NOTICE);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.settings.versionUpFlash != "") {
|
||||
Logger($msg("Replicator.Message.VersionUpFlash"), LOG_LEVEL_NOTICE);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(await this.core.$everyCommitPendingFileEvent())) {
|
||||
Logger($msg("Replicator.Message.Pending"), LOG_LEVEL_NOTICE);
|
||||
return false;
|
||||
@@ -197,6 +203,12 @@ Even if you choose to clean up, you will see this option again if you exit Obsid
|
||||
Logger($msg("Replicator.Message.SomeModuleFailed"), LOG_LEVEL_NOTICE);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async $$_replicate(showMessage: boolean = false): Promise<boolean | void> {
|
||||
const checkBeforeReplicate = await this.$$canReplicate(showMessage);
|
||||
if (!checkBeforeReplicate) return false;
|
||||
|
||||
//<-- Here could be an module.
|
||||
const ret = await this.core.replicator.openReplication(this.settings, false, showMessage, false);
|
||||
|
||||
@@ -15,15 +15,22 @@ export class ModuleReplicatorCouchDB extends AbstractModule implements ICoreModu
|
||||
return Promise.resolve(new LiveSyncCouchDBReplicator(this.core));
|
||||
}
|
||||
$everyAfterResumeProcess(): Promise<boolean> {
|
||||
if (!this.core.$$isSuspended) return Promise.resolve(true);
|
||||
if (!this.core.$$isReady) return Promise.resolve(true);
|
||||
if (this.settings.remoteType != REMOTE_MINIO && this.settings.remoteType != REMOTE_P2P) {
|
||||
// If LiveSync enabled, open replication
|
||||
if (this.settings.liveSync) {
|
||||
fireAndForget(() => this.core.$$replicate(false));
|
||||
}
|
||||
// If sync on start enabled, open replication
|
||||
if (!this.settings.liveSync && this.settings.syncOnStart) {
|
||||
// Possibly ok as if only share the result
|
||||
fireAndForget(() => this.core.$$replicate(false));
|
||||
const LiveSyncEnabled = this.settings.liveSync;
|
||||
const continuous = LiveSyncEnabled;
|
||||
const eventualOnStart = !LiveSyncEnabled && this.settings.syncOnStart;
|
||||
|
||||
// If enabled LiveSync or on start, open replication
|
||||
if (LiveSyncEnabled || eventualOnStart) {
|
||||
// And note that we do not open the conflict detection dialogue directly during this process.
|
||||
// This should be raised explicitly if needed.
|
||||
fireAndForget(async () => {
|
||||
const canReplicate = await this.core.$$canReplicate(false);
|
||||
if (!canReplicate) return;
|
||||
void this.core.replicator.openReplication(this.settings, continuous, false, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
45
updates.md
45
updates.md
@@ -1,3 +1,11 @@
|
||||
## 0.25.12
|
||||
|
||||
29th August, 2025
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed an issue with automatic synchronisation starting (#702).
|
||||
|
||||
## 0.25.11
|
||||
|
||||
28th August, 2025
|
||||
@@ -59,43 +67,6 @@
|
||||
|
||||
- Type errors have been corrected.
|
||||
|
||||
## 0.25.7
|
||||
|
||||
15th August, 2025
|
||||
|
||||
**Since the release of 0.25.6, there are two large problem. Please update immediately.**
|
||||
|
||||
- We may have corrupted some documents during the migration process. **Please check your documents on the wizard.**
|
||||
- Due to a chunk ID assignment issue, some data has not been encrypted. **Please rebuild the database using Rebuild Everything** if you have enabled E2EE.
|
||||
|
||||
**_So, If you have enabled E2EE, please perform `Rebuild everything`. If not, please check your documents on the wizard._**
|
||||
|
||||
In next version, insecure chunk detection will be implemented.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Off-loaded chunking have been fixed to ensure proper functionality (#693).
|
||||
- Chunk document ID assignment has been fixed.
|
||||
- Replication prevention message during version up detection has been improved (#686).
|
||||
- `Keep A` and `Keep B` on Conflict resolving dialogue has been renamed to `Use Base` and `Use Conflicted` (#691).
|
||||
|
||||
### Improved
|
||||
|
||||
- Metadata and content-size unmatched documents are now detected and reported, prevented to be applied to the storage.
|
||||
- This behaviour can be configured in `Patch` -> `Edge case addressing (Behaviour)` -> `Process files even if seems to be corrupted`
|
||||
- Note: this toggle is for the direct-database-manipulation users.
|
||||
|
||||
### New Features
|
||||
|
||||
- `Scan for Broken files` has been implemented on `Hatch` -> `TroubleShooting`.
|
||||
|
||||
### Refactored
|
||||
|
||||
- Off-loaded processes have been refactored for the better maintainability.
|
||||
- Files prefixed `bg.worker` are now work on the worker threads.
|
||||
- Files prefixed `bgWorker.` are now also controls these worker threads. (I know what you want to say... I will rename them).
|
||||
- Removed unused code.
|
||||
|
||||
## 0.25.0
|
||||
|
||||
19th July, 2025 (beta1 in 0.25.0-beta1, 13th July, 2025)
|
||||
|
||||
@@ -11,6 +11,45 @@ As a result, this is the first time in a while that forward compatibility has be
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 0.25.7
|
||||
|
||||
15th August, 2025
|
||||
|
||||
**Since the release of 0.25.6, there are two large problem. Please update immediately.**
|
||||
|
||||
- We may have corrupted some documents during the migration process. **Please check your documents on the wizard.**
|
||||
- Due to a chunk ID assignment issue, some data has not been encrypted. **Please rebuild the database using Rebuild Everything** if you have enabled E2EE.
|
||||
|
||||
**_So, If you have enabled E2EE, please perform `Rebuild everything`. If not, please check your documents on the wizard._**
|
||||
|
||||
In next version, insecure chunk detection will be implemented.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Off-loaded chunking have been fixed to ensure proper functionality (#693).
|
||||
- Chunk document ID assignment has been fixed.
|
||||
- Replication prevention message during version up detection has been improved (#686).
|
||||
- `Keep A` and `Keep B` on Conflict resolving dialogue has been renamed to `Use Base` and `Use Conflicted` (#691).
|
||||
|
||||
### Improved
|
||||
|
||||
- Metadata and content-size unmatched documents are now detected and reported, prevented to be applied to the storage.
|
||||
- This behaviour can be configured in `Patch` -> `Edge case addressing (Behaviour)` -> `Process files even if seems to be corrupted`
|
||||
- Note: this toggle is for the direct-database-manipulation users.
|
||||
|
||||
### New Features
|
||||
|
||||
- `Scan for Broken files` has been implemented on `Hatch` -> `TroubleShooting`.
|
||||
|
||||
### Refactored
|
||||
|
||||
- Off-loaded processes have been refactored for the better maintainability.
|
||||
- Files prefixed `bg.worker` are now work on the worker threads.
|
||||
- Files prefixed `bgWorker.` are now also controls these worker threads. (I know what you want to say... I will rename them).
|
||||
- Removed unused code.
|
||||
|
||||
|
||||
## ~~0.25.5~~ 0.25.6
|
||||
|
||||
(0.25.5 has been withdrawn due to a bug in the `Fetch chunks on demand` feature).
|
||||
|
||||
Reference in New Issue
Block a user