From f0ffb0620ec86e0d71e78b989e18749637d0fadd Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Fri, 29 Jul 2022 13:33:33 +0900 Subject: [PATCH] Fixed file deletion failures. --- manifest.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/LocalPouchDB.ts | 2 +- src/main.ts | 2 +- updates.md | 3 ++- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/manifest.json b/manifest.json index 5d67e1a..6ac5358 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "obsidian-livesync", "name": "Self-hosted LiveSync", - "version": "0.13.1", + "version": "0.13.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 a125c20..f4e3ce6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "obsidian-livesync", - "version": "0.13.1", + "version": "0.13.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "obsidian-livesync", - "version": "0.13.1", + "version": "0.13.2", "license": "MIT", "dependencies": { "diff-match-patch": "^1.0.5", diff --git a/package.json b/package.json index 2dabfd5..eb60aef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-livesync", - "version": "0.13.1", + "version": "0.13.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/LocalPouchDB.ts b/src/LocalPouchDB.ts index b23ecc9..e7d3068 100644 --- a/src/LocalPouchDB.ts +++ b/src/LocalPouchDB.ts @@ -462,7 +462,7 @@ export class LocalPouchDB { } else { obj = await this.localDatabase.get(id); } - const revDeletion = ("rev" in opt ? opt.rev : "") != ""; + const revDeletion = opt && (("rev" in opt ? opt.rev : "") != ""); if (obj.type && obj.type == "leaf") { //do nothing for leaf; diff --git a/src/main.ts b/src/main.ts index e3ff705..fdca52f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -821,7 +821,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin { try { Logger(`file save ${file.path} into db`); await this.updateIntoDB(file); - Logger(`deleted ${oldFile} into db`); + Logger(`deleted ${oldFile} from db`); await this.deleteFromDBbyPath(oldFile); } catch (ex) { Logger(ex); diff --git a/updates.md b/updates.md index 08f678d..5f48f34 100644 --- a/updates.md +++ b/updates.md @@ -8,4 +8,5 @@ - Update information became to be shown on the major upgrade. #### Minors -- 0.13.1 Fixed on conflict resolution. \ No newline at end of file +- 0.13.1 Fixed on conflict resolution. +- 0.13.2 Fixed file deletion failures. \ No newline at end of file