diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 7e229e1b..1837d188 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -1479,7 +1479,7 @@ dependencies = [ [[package]] name = "reconcile" -version = "0.0.16" +version = "0.0.17" dependencies = [ "insta", "pretty_assertions", @@ -1489,7 +1489,7 @@ dependencies = [ [[package]] name = "reconcile-fuzz" -version = "0.0.16" +version = "0.0.17" dependencies = [ "libfuzzer-sys", "reconcile", @@ -2104,7 +2104,7 @@ dependencies = [ [[package]] name = "sync_lib" -version = "0.0.16" +version = "0.0.17" dependencies = [ "base64 0.22.1", "console_error_panic_hook", @@ -2117,7 +2117,7 @@ dependencies = [ [[package]] name = "sync_server" -version = "0.0.16" +version = "0.0.17" dependencies = [ "aide", "anyhow", diff --git a/backend/fuzz/Cargo.toml b/backend/fuzz/Cargo.toml index 40b93a11..2a405db4 100644 --- a/backend/fuzz/Cargo.toml +++ b/backend/fuzz/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reconcile-fuzz" -version = "0.0.16" +version = "0.0.17" publish = false edition = "2021" diff --git a/backend/reconcile/Cargo.toml b/backend/reconcile/Cargo.toml index 3a844f73..88c2d239 100644 --- a/backend/reconcile/Cargo.toml +++ b/backend/reconcile/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "reconcile" -version = "0.0.16" +version = "0.0.17" edition = "2021" [dependencies] diff --git a/backend/sync_lib/Cargo.toml b/backend/sync_lib/Cargo.toml index 940600c1..9001ddbc 100644 --- a/backend/sync_lib/Cargo.toml +++ b/backend/sync_lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sync_lib" -version = "0.0.16" +version = "0.0.17" authors = ["Andras Schmelczer "] edition = "2018" diff --git a/backend/sync_server/Cargo.toml b/backend/sync_server/Cargo.toml index 8d06b4d6..73d31087 100644 --- a/backend/sync_server/Cargo.toml +++ b/backend/sync_server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sync_server" -version = "0.0.16" +version = "0.0.17" edition = "2021" [dependencies] diff --git a/bump-version.sh b/bump-version.sh index ceab2e65..b17842be 100755 --- a/bump-version.sh +++ b/bump-version.sh @@ -33,6 +33,8 @@ npm version patch echo "Updating frontend dependencies to match the new backend versions" cd ../backend/sync_lib wasm-pack build --target web --features console_error_panic_hook + +cd ../../plugin npm install cd .. diff --git a/manifest.json b/manifest.json index e28cc520..cc191879 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "vault-link", "name": "VaultLink", - "version": "0.0.16", + "version": "0.0.17", "minAppVersion": "0.0.0", "description": "Self-hosted synchronization and collaboration for your Vault.", "author": "Andras Schmelczer", diff --git a/plugin/manifest.json b/plugin/manifest.json index e28cc520..cc191879 100644 --- a/plugin/manifest.json +++ b/plugin/manifest.json @@ -1,7 +1,7 @@ { "id": "vault-link", "name": "VaultLink", - "version": "0.0.16", + "version": "0.0.17", "minAppVersion": "0.0.0", "description": "Self-hosted synchronization and collaboration for your Vault.", "author": "Andras Schmelczer", diff --git a/plugin/package-lock.json b/plugin/package-lock.json index acfc477e..d77e7c4c 100644 --- a/plugin/package-lock.json +++ b/plugin/package-lock.json @@ -1,12 +1,12 @@ { "name": "vault-link-obsidian-plugin", - "version": "0.0.16", + "version": "0.0.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vault-link-obsidian-plugin", - "version": "0.0.16", + "version": "0.0.17", "license": "MIT", "devDependencies": { "@types/jest": "^29.5.14", @@ -46,7 +46,7 @@ }, "../backend/sync_lib/pkg": { "name": "sync_lib", - "version": "0.0.16", + "version": "0.0.17", "dev": true }, "node_modules/@ampproject/remapping": { diff --git a/plugin/package.json b/plugin/package.json index 0266441d..200e1365 100644 --- a/plugin/package.json +++ b/plugin/package.json @@ -1,6 +1,6 @@ { "name": "vault-link-obsidian-plugin", - "version": "0.0.16", + "version": "0.0.17", "description": "This is a sample plugin for Obsidian (https://obsidian.md)", "main": "main.js", "scripts": { diff --git a/plugin/src/sync-operations/syncer.ts b/plugin/src/sync-operations/syncer.ts index bbf4360f..b8a3f4ce 100644 --- a/plugin/src/sync-operations/syncer.ts +++ b/plugin/src/sync-operations/syncer.ts @@ -284,6 +284,7 @@ export class Syncer { const localMetadata = this.database.getDocument( oldPath ?? relativePath ); + console.log(JSON.stringify(localMetadata)); if (!localMetadata) { if (this.database.getDocument(relativePath)) { this.history.addHistoryEntry({ @@ -299,9 +300,13 @@ export class Syncer { `Document metadata not found for ${relativePath}. This implies a corrupt local database. Consider resetting the plugin's sync history.` ); } + console.log("about to read", relativePath); const contentBytes = await this.operations.read(relativePath); + console.log("has read", relativePath); + let contentHash = hash(contentBytes); + console.log("has hashed", relativePath); if ( localMetadata.hash === contentHash && @@ -316,6 +321,8 @@ export class Syncer { return; } + console.log("about to send", relativePath); + const response = await this.syncService.put({ documentId: localMetadata.documentId, parentVersionId: localMetadata.parentVersionId, @@ -324,6 +331,8 @@ export class Syncer { createdDate: updateTime }); + console.log("has sent", relativePath); + this.history.addHistoryEntry({ status: SyncStatus.SUCCESS, source: SyncSource.PUSH, @@ -364,15 +373,22 @@ export class Syncer { } if (response.type === "MergingUpdate") { + console.log( + "about to deserialize", + response.contentBase64 + ); const responseBytes = deserialize( response.contentBase64 ); + console.log("has deserialized", response.relativePath); contentHash = hash(responseBytes); + console.log("about to write", response.relativePath); await this.operations.write( response.relativePath, contentBytes, responseBytes ); + console.log("has written", response.relativePath); this.history.addHistoryEntry({ status: SyncStatus.SUCCESS,