mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-05-19 22:11:23 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2100e22276 | ||
|
|
ec08dc5fe8 | ||
|
|
c92e94e552 | ||
|
|
c7db8592c6 | ||
|
|
fc3617d9f9 | ||
|
|
34c1b040db | ||
|
|
6b85aecafe |
@@ -1,3 +1,4 @@
|
|||||||
npm node_modules
|
node_modules
|
||||||
build
|
build
|
||||||
.eslintrc.js.bak
|
.eslintrc.js.bak
|
||||||
|
src/lib/src/patches/pouchdb-utils
|
||||||
@@ -25,14 +25,16 @@ esbuild
|
|||||||
"MANIFEST_VERSION": `"${manifestJson.version}"`,
|
"MANIFEST_VERSION": `"${manifestJson.version}"`,
|
||||||
"PACKAGE_VERSION": `"${packageJson.version}"`,
|
"PACKAGE_VERSION": `"${packageJson.version}"`,
|
||||||
"UPDATE_INFO": `${updateInfo}`,
|
"UPDATE_INFO": `${updateInfo}`,
|
||||||
|
"global":"window",
|
||||||
},
|
},
|
||||||
external: ["obsidian", "electron", ...builtins],
|
external: ["obsidian", "electron", "crypto"],
|
||||||
format: "cjs",
|
format: "cjs",
|
||||||
watch: !prod,
|
watch: !prod,
|
||||||
target: "es2018",
|
target: "es2018",
|
||||||
logLevel: "info",
|
logLevel: "info",
|
||||||
sourcemap: prod ? false : "inline",
|
sourcemap: prod ? false : "inline",
|
||||||
treeShaking: true,
|
treeShaking: true,
|
||||||
|
platform: "browser",
|
||||||
plugins: [
|
plugins: [
|
||||||
sveltePlugin({
|
sveltePlugin({
|
||||||
preprocess: sveltePreprocess(),
|
preprocess: sveltePreprocess(),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "obsidian-livesync",
|
"id": "obsidian-livesync",
|
||||||
"name": "Self-hosted LiveSync",
|
"name": "Self-hosted LiveSync",
|
||||||
"version": "0.17.5",
|
"version": "0.17.8",
|
||||||
"minAppVersion": "0.9.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.",
|
"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",
|
"author": "vorotamoroz",
|
||||||
|
|||||||
846
package-lock.json
generated
846
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-livesync",
|
"name": "obsidian-livesync",
|
||||||
"version": "0.17.5",
|
"version": "0.17.8",
|
||||||
"description": "Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.",
|
"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",
|
"main": "main.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -24,11 +24,20 @@
|
|||||||
"eslint": "^8.28.0",
|
"eslint": "^8.28.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.26.0",
|
||||||
|
"events": "^3.3.0",
|
||||||
"obsidian": "^0.16.3",
|
"obsidian": "^0.16.3",
|
||||||
"postcss": "^8.4.19",
|
"postcss": "^8.4.19",
|
||||||
"postcss-load-config": "^4.0.1",
|
"postcss-load-config": "^4.0.1",
|
||||||
|
"pouchdb-adapter-http": "^8.0.0",
|
||||||
|
"pouchdb-adapter-idb": "^8.0.0",
|
||||||
|
"pouchdb-core": "^8.0.0",
|
||||||
|
"pouchdb-find": "^8.0.0",
|
||||||
|
"pouchdb-mapreduce": "^8.0.0",
|
||||||
|
"pouchdb-replication": "^8.0.0",
|
||||||
|
"pouchdb-utils": "file:src/lib/src/patches/pouchdb-utils",
|
||||||
"svelte": "^3.53.1",
|
"svelte": "^3.53.1",
|
||||||
"svelte-preprocess": "^4.10.7",
|
"svelte-preprocess": "^4.10.7",
|
||||||
|
"transform-pouch": "^2.0.0",
|
||||||
"tslib": "^2.4.1",
|
"tslib": "^2.4.1",
|
||||||
"typescript": "^4.9.3"
|
"typescript": "^4.9.3"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
if (this.plugin.settings.syncOnFileOpen) return true;
|
if (this.plugin.settings.syncOnFileOpen) return true;
|
||||||
if (this.plugin.settings.syncOnSave) return true;
|
if (this.plugin.settings.syncOnSave) return true;
|
||||||
if (this.plugin.settings.syncOnStart) return true;
|
if (this.plugin.settings.syncOnStart) return true;
|
||||||
|
if (this.plugin.settings.syncAfterMerge) return true;
|
||||||
if (this.plugin.localDatabase.syncStatus == "CONNECTED") return true;
|
if (this.plugin.localDatabase.syncStatus == "CONNECTED") return true;
|
||||||
if (this.plugin.localDatabase.syncStatus == "PAUSED") return true;
|
if (this.plugin.localDatabase.syncStatus == "PAUSED") return true;
|
||||||
return false;
|
return false;
|
||||||
@@ -144,7 +145,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
new Setting(setupWizardEl)
|
new Setting(setupWizardEl)
|
||||||
.setName("Discard the existing configuration and set up")
|
.setName("Discard the existing configuration and set up")
|
||||||
.addButton((text) => {
|
.addButton((text) => {
|
||||||
text.setButtonText("Next").onClick(async () => {
|
text.setButtonText("Next").onClick(() => {
|
||||||
if (JSON.stringify(this.plugin.settings) != JSON.stringify(DEFAULT_SETTINGS)) {
|
if (JSON.stringify(this.plugin.settings) != JSON.stringify(DEFAULT_SETTINGS)) {
|
||||||
this.plugin.localDatabase.closeReplication();
|
this.plugin.localDatabase.closeReplication();
|
||||||
this.plugin.settings = { ...DEFAULT_SETTINGS };
|
this.plugin.settings = { ...DEFAULT_SETTINGS };
|
||||||
@@ -170,6 +171,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
this.plugin.settings.syncOnSave = false;
|
this.plugin.settings.syncOnSave = false;
|
||||||
this.plugin.settings.syncOnStart = false;
|
this.plugin.settings.syncOnStart = false;
|
||||||
this.plugin.settings.syncOnFileOpen = false;
|
this.plugin.settings.syncOnFileOpen = false;
|
||||||
|
this.plugin.settings.syncAfterMerge = false;
|
||||||
this.plugin.localDatabase.closeReplication();
|
this.plugin.localDatabase.closeReplication();
|
||||||
await this.plugin.saveSettings();
|
await this.plugin.saveSettings();
|
||||||
containerEl.addClass("isWizard");
|
containerEl.addClass("isWizard");
|
||||||
@@ -226,7 +228,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
syncLive.forEach((e) => {
|
syncLive.forEach((e) => {
|
||||||
e.setDisabled(false).setTooltip("");
|
e.setDisabled(false).setTooltip("");
|
||||||
});
|
});
|
||||||
} else if (this.plugin.settings.syncOnFileOpen || this.plugin.settings.syncOnSave || this.plugin.settings.syncOnStart || this.plugin.settings.periodicReplication) {
|
} else if (this.plugin.settings.syncOnFileOpen || this.plugin.settings.syncOnSave || this.plugin.settings.syncOnStart || this.plugin.settings.periodicReplication || this.plugin.settings.syncAfterMerge) {
|
||||||
syncNonLive.forEach((e) => {
|
syncNonLive.forEach((e) => {
|
||||||
e.setDisabled(false).setTooltip("");
|
e.setDisabled(false).setTooltip("");
|
||||||
});
|
});
|
||||||
@@ -387,6 +389,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
this.plugin.settings.syncOnSave = false;
|
this.plugin.settings.syncOnSave = false;
|
||||||
this.plugin.settings.syncOnStart = false;
|
this.plugin.settings.syncOnStart = false;
|
||||||
this.plugin.settings.syncOnFileOpen = false;
|
this.plugin.settings.syncOnFileOpen = false;
|
||||||
|
this.plugin.settings.syncAfterMerge = false;
|
||||||
this.plugin.settings.encrypt = this.plugin.settings.workingEncrypt;
|
this.plugin.settings.encrypt = this.plugin.settings.workingEncrypt;
|
||||||
this.plugin.settings.passphrase = this.plugin.settings.workingPassphrase;
|
this.plugin.settings.passphrase = this.plugin.settings.workingPassphrase;
|
||||||
this.plugin.settings.useDynamicIterationCount = this.plugin.settings.workingUseDynamicIterationCount;
|
this.plugin.settings.useDynamicIterationCount = this.plugin.settings.workingUseDynamicIterationCount;
|
||||||
@@ -412,7 +415,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.setButtonText("Apply")
|
.setButtonText("Apply")
|
||||||
.setWarning()
|
.setWarning()
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setClass("sls-btn-right")
|
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
await applyEncryption(true);
|
await applyEncryption(true);
|
||||||
})
|
})
|
||||||
@@ -422,7 +424,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.setButtonText("Apply w/o rebuilding")
|
.setButtonText("Apply w/o rebuilding")
|
||||||
.setWarning()
|
.setWarning()
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setClass("sls-btn-right")
|
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
await applyEncryption(false);
|
await applyEncryption(false);
|
||||||
})
|
})
|
||||||
@@ -435,7 +436,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
this.plugin.settings.syncOnSave = false;
|
this.plugin.settings.syncOnSave = false;
|
||||||
this.plugin.settings.syncOnStart = false;
|
this.plugin.settings.syncOnStart = false;
|
||||||
this.plugin.settings.syncOnFileOpen = false;
|
this.plugin.settings.syncOnFileOpen = false;
|
||||||
|
this.plugin.settings.syncAfterMerge = false;
|
||||||
await this.plugin.saveSettings();
|
await this.plugin.saveSettings();
|
||||||
|
|
||||||
applyDisplayEnabled();
|
applyDisplayEnabled();
|
||||||
@@ -470,7 +471,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.setButtonText("Send")
|
.setButtonText("Send")
|
||||||
.setWarning()
|
.setWarning()
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setClass("sls-btn-left")
|
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
await rebuildDB("remoteOnly");
|
await rebuildDB("remoteOnly");
|
||||||
})
|
})
|
||||||
@@ -485,7 +485,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.setButtonText("Rebuild")
|
.setButtonText("Rebuild")
|
||||||
.setWarning()
|
.setWarning()
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setClass("sls-btn-left")
|
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
await rebuildDB("rebuildBothByThisDevice");
|
await rebuildDB("rebuildBothByThisDevice");
|
||||||
})
|
})
|
||||||
@@ -697,7 +696,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.setButtonText("Next")
|
.setButtonText("Next")
|
||||||
.setClass("mod-cta")
|
.setClass("mod-cta")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.onClick(async () => {
|
.onClick(() => {
|
||||||
if (!this.plugin.settings.encrypt) {
|
if (!this.plugin.settings.encrypt) {
|
||||||
this.plugin.settings.passphrase = "";
|
this.plugin.settings.passphrase = "";
|
||||||
}
|
}
|
||||||
@@ -718,7 +717,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.setButtonText("Discard exist database and proceed")
|
.setButtonText("Discard exist database and proceed")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setWarning()
|
.setWarning()
|
||||||
.onClick(async () => {
|
.onClick(() => {
|
||||||
if (!this.plugin.settings.encrypt) {
|
if (!this.plugin.settings.encrypt) {
|
||||||
this.plugin.settings.passphrase = "";
|
this.plugin.settings.passphrase = "";
|
||||||
}
|
}
|
||||||
@@ -760,7 +759,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.setButtonText("Fetch")
|
.setButtonText("Fetch")
|
||||||
.setWarning()
|
.setWarning()
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setClass("sls-btn-left")
|
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
await rebuildDB("localOnly");
|
await rebuildDB("localOnly");
|
||||||
})
|
})
|
||||||
@@ -798,7 +796,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
button
|
button
|
||||||
.setButtonText("Next")
|
.setButtonText("Next")
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.onClick(async () => {
|
.onClick(() => {
|
||||||
changeDisplay("40");
|
changeDisplay("40");
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -954,7 +952,17 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
await this.plugin.saveSettings();
|
await this.plugin.saveSettings();
|
||||||
applyDisplayEnabled();
|
applyDisplayEnabled();
|
||||||
})
|
})
|
||||||
)
|
),
|
||||||
|
new Setting(containerSyncSettingEl)
|
||||||
|
.setName("Sync after merging file")
|
||||||
|
.setDesc("Sync automatically after merging files")
|
||||||
|
.addToggle((toggle) =>
|
||||||
|
toggle.setValue(this.plugin.settings.syncAfterMerge).onChange(async (value) => {
|
||||||
|
this.plugin.settings.syncAfterMerge = value;
|
||||||
|
await this.plugin.saveSettings();
|
||||||
|
applyDisplayEnabled();
|
||||||
|
})
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
new Setting(containerSyncSettingEl)
|
new Setting(containerSyncSettingEl)
|
||||||
@@ -1103,7 +1111,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
.setButtonText("Touch")
|
.setButtonText("Touch")
|
||||||
.setWarning()
|
.setWarning()
|
||||||
.setDisabled(false)
|
.setDisabled(false)
|
||||||
.setClass("sls-btn-left")
|
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
const filesAll = await this.plugin.scanInternalFiles();
|
const filesAll = await this.plugin.scanInternalFiles();
|
||||||
const targetFiles = await this.plugin.filterTargetFiles(filesAll);
|
const targetFiles = await this.plugin.filterTargetFiles(filesAll);
|
||||||
@@ -1278,6 +1285,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
this.plugin.settings.syncOnSave = false;
|
this.plugin.settings.syncOnSave = false;
|
||||||
this.plugin.settings.syncOnStart = false;
|
this.plugin.settings.syncOnStart = false;
|
||||||
this.plugin.settings.syncOnFileOpen = false;
|
this.plugin.settings.syncOnFileOpen = false;
|
||||||
|
this.plugin.settings.syncAfterMerge = false;
|
||||||
if (currentPreset == "LIVESYNC") {
|
if (currentPreset == "LIVESYNC") {
|
||||||
this.plugin.settings.liveSync = true;
|
this.plugin.settings.liveSync = true;
|
||||||
Logger("Synchronization setting configured as LiveSync.", LOG_LEVEL.NOTICE);
|
Logger("Synchronization setting configured as LiveSync.", LOG_LEVEL.NOTICE);
|
||||||
@@ -1287,6 +1295,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
this.plugin.settings.syncOnSave = false;
|
this.plugin.settings.syncOnSave = false;
|
||||||
this.plugin.settings.syncOnStart = true;
|
this.plugin.settings.syncOnStart = true;
|
||||||
this.plugin.settings.syncOnFileOpen = true;
|
this.plugin.settings.syncOnFileOpen = true;
|
||||||
|
this.plugin.settings.syncAfterMerge = true;
|
||||||
Logger("Synchronization setting configured as Periodic sync with batch database update.", LOG_LEVEL.NOTICE);
|
Logger("Synchronization setting configured as Periodic sync with batch database update.", LOG_LEVEL.NOTICE);
|
||||||
} else {
|
} else {
|
||||||
Logger("All synchronization disabled.", LOG_LEVEL.NOTICE);
|
Logger("All synchronization disabled.", LOG_LEVEL.NOTICE);
|
||||||
|
|||||||
2
src/lib
2
src/lib
Submodule src/lib updated: 9fe5ce421f...4ef5986b4d
19
src/main.ts
19
src/main.ts
@@ -309,6 +309,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
this.settings.syncOnSave = false;
|
this.settings.syncOnSave = false;
|
||||||
this.settings.syncOnStart = false;
|
this.settings.syncOnStart = false;
|
||||||
this.settings.syncOnFileOpen = false;
|
this.settings.syncOnFileOpen = false;
|
||||||
|
this.settings.syncAfterMerge = false;
|
||||||
this.settings.periodicReplication = false;
|
this.settings.periodicReplication = false;
|
||||||
this.settings.versionUpFlash = "Self-hosted LiveSync has been upgraded and some behaviors have changed incompatibly. All automatic synchronization is now disabled temporary. Ensure that other devices are also upgraded, and enable synchronization again.";
|
this.settings.versionUpFlash = "Self-hosted LiveSync has been upgraded and some behaviors have changed incompatibly. All automatic synchronization is now disabled temporary. Ensure that other devices are also upgraded, and enable synchronization again.";
|
||||||
this.saveSettings();
|
this.saveSettings();
|
||||||
@@ -375,6 +376,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
this.settings.syncOnSave = false;
|
this.settings.syncOnSave = false;
|
||||||
this.settings.syncOnStart = false;
|
this.settings.syncOnStart = false;
|
||||||
this.settings.syncOnFileOpen = false;
|
this.settings.syncOnFileOpen = false;
|
||||||
|
this.settings.syncAfterMerge = false;
|
||||||
this.settings.autoSweepPlugins = false;
|
this.settings.autoSweepPlugins = false;
|
||||||
this.settings.usePluginSync = false;
|
this.settings.usePluginSync = false;
|
||||||
this.settings.suspendFileWatching = true;
|
this.settings.suspendFileWatching = true;
|
||||||
@@ -1382,7 +1384,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
await this.doc2storage_modify(doc, file);
|
await this.doc2storage_modify(doc, file);
|
||||||
queueConflictCheck();
|
queueConflictCheck();
|
||||||
} else {
|
} else {
|
||||||
const d = await this.localDatabase.getDBEntryMeta(id2path(change._id), { conflicts: true })
|
const d = await this.localDatabase.getDBEntryMeta(id2path(change._id), { conflicts: true }, true);
|
||||||
if (d && !d._conflicts) {
|
if (d && !d._conflicts) {
|
||||||
await this.doc2storage_modify(doc, file);
|
await this.doc2storage_modify(doc, file);
|
||||||
} else {
|
} else {
|
||||||
@@ -2176,7 +2178,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
const conflictedRevNo = Number(conflictedRev.split("-")[0]);
|
const conflictedRevNo = Number(conflictedRev.split("-")[0]);
|
||||||
//Search
|
//Search
|
||||||
const revFrom = (await this.localDatabase.localDatabase.get(id2path(path), { revs_info: true })) as unknown as LoadedEntry & PouchDB.Core.GetMeta;
|
const revFrom = (await this.localDatabase.localDatabase.get(id2path(path), { revs_info: true })) as unknown as LoadedEntry & PouchDB.Core.GetMeta;
|
||||||
const commonBase = revFrom._revs_info.filter(e => e.status == "available" && Number(e.rev.split("-")[0]) < conflictedRevNo).first().rev ?? "";
|
const commonBase = revFrom._revs_info.filter(e => e.status == "available" && Number(e.rev.split("-")[0]) < conflictedRevNo).first()?.rev ?? "";
|
||||||
let p = undefined;
|
let p = undefined;
|
||||||
if (commonBase) {
|
if (commonBase) {
|
||||||
if (isSensibleMargeApplicable(path)) {
|
if (isSensibleMargeApplicable(path)) {
|
||||||
@@ -2297,6 +2299,9 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
await this.pullFile(filename);
|
await this.pullFile(filename);
|
||||||
Logger("concat both file");
|
Logger("concat both file");
|
||||||
|
if (this.settings.syncAfterMerge && !this.suspended) {
|
||||||
|
await this.replicate();
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
//resolved, check again.
|
//resolved, check again.
|
||||||
this.showIfConflicted(filename);
|
this.showIfConflicted(filename);
|
||||||
@@ -2304,9 +2309,12 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
} else if (toDelete == null) {
|
} else if (toDelete == null) {
|
||||||
Logger("Leave it still conflicted");
|
Logger("Leave it still conflicted");
|
||||||
} else {
|
} else {
|
||||||
Logger(`Conflict resolved:${filename}`);
|
|
||||||
await this.localDatabase.deleteDBEntry(filename, { rev: toDelete });
|
await this.localDatabase.deleteDBEntry(filename, { rev: toDelete });
|
||||||
await this.pullFile(filename, null, true, toKeep);
|
await this.pullFile(filename, null, true, toKeep);
|
||||||
|
Logger(`Conflict resolved:${filename}`);
|
||||||
|
if (this.settings.syncAfterMerge && !this.suspended) {
|
||||||
|
await this.replicate();
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
//resolved, check again.
|
//resolved, check again.
|
||||||
this.showIfConflicted(filename);
|
this.showIfConflicted(filename);
|
||||||
@@ -2354,6 +2362,9 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
if (conflictCheckResult === true) {
|
if (conflictCheckResult === true) {
|
||||||
//auto resolved, but need check again;
|
//auto resolved, but need check again;
|
||||||
|
if (this.settings.syncAfterMerge && !this.suspended) {
|
||||||
|
await this.replicate();
|
||||||
|
}
|
||||||
Logger("conflict:Automatically merged, but we have to check it again");
|
Logger("conflict:Automatically merged, but we have to check it again");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.showIfConflicted(filename);
|
this.showIfConflicted(filename);
|
||||||
@@ -2970,7 +2981,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
|||||||
const conflictedRevNo = Number(conflictedRev.split("-")[0]);
|
const conflictedRevNo = Number(conflictedRev.split("-")[0]);
|
||||||
//Search
|
//Search
|
||||||
const revFrom = (await this.localDatabase.localDatabase.get(id, { revs_info: true })) as unknown as LoadedEntry & PouchDB.Core.GetMeta;
|
const revFrom = (await this.localDatabase.localDatabase.get(id, { revs_info: true })) as unknown as LoadedEntry & PouchDB.Core.GetMeta;
|
||||||
const commonBase = revFrom._revs_info.filter(e => e.status == "available" && Number(e.rev.split("-")[0]) < conflictedRevNo).first().rev ?? "";
|
const commonBase = revFrom._revs_info.filter(e => e.status == "available" && Number(e.rev.split("-")[0]) < conflictedRevNo).first()?.rev ?? "";
|
||||||
const result = await this.mergeObject(id, commonBase, doc._rev, conflictedRev);
|
const result = await this.mergeObject(id, commonBase, doc._rev, conflictedRev);
|
||||||
if (result) {
|
if (result) {
|
||||||
Logger(`Object merge:${id}`, LOG_LEVEL.INFO);
|
Logger(`Object merge:${id}`, LOG_LEVEL.INFO);
|
||||||
|
|||||||
@@ -85,13 +85,6 @@
|
|||||||
|
|
||||||
} */
|
} */
|
||||||
|
|
||||||
.sls-btn-left {
|
|
||||||
padding-right: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sls-btn-right {
|
|
||||||
padding-left: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sls-header-button {
|
.sls-header-button {
|
||||||
margin-left: 2em;
|
margin-left: 2em;
|
||||||
|
|||||||
13
updates.md
13
updates.md
@@ -28,6 +28,19 @@
|
|||||||
|
|
||||||
- 0.17.5 Now `read chunks online` had been fixed, and a new feature: `Use dynamic iteration count` to reduce the load on encryption/decryption.
|
- 0.17.5 Now `read chunks online` had been fixed, and a new feature: `Use dynamic iteration count` to reduce the load on encryption/decryption.
|
||||||
Note: `Use dynamic iteration count` is not compatible with earlier versions.
|
Note: `Use dynamic iteration count` is not compatible with earlier versions.
|
||||||
|
- 0.17.6 Now our renamed/deleted files have been surely deleted again.
|
||||||
|
- 0.17.7
|
||||||
|
- Fixed:
|
||||||
|
- Fixed merging issues.
|
||||||
|
- Fixed button styling.
|
||||||
|
- Changed:
|
||||||
|
- Conflict checking on synchronising has been enabled for every note in default.
|
||||||
|
|
||||||
|
- 0.17.8
|
||||||
|
- Improved: Performance improved. Prebuilt PouchDB is no longer used.
|
||||||
|
- Fixed: Merging hidden files is also fixed.
|
||||||
|
- New Feature: Now we can synchronise automatically after merging conflicts.
|
||||||
|
|
||||||
### 0.16.0
|
### 0.16.0
|
||||||
- Now hidden files need not be scanned. Changes will be detected automatically.
|
- Now hidden files need not be scanned. Changes will be detected automatically.
|
||||||
- If you want it to back to its previous behaviour, please disable `Monitor changes to internal files`.
|
- If you want it to back to its previous behaviour, please disable `Monitor changes to internal files`.
|
||||||
|
|||||||
Reference in New Issue
Block a user