From 5c6c3652aef63f1679dab741c81456ca563a889e Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Mon, 6 Jan 2025 21:55:20 +0000 Subject: [PATCH 1/4] Add log lines --- plugin/src/sync-operations/syncer.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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, From 13ac3bb14022433a715917adf93d8d6f6f8fb50d Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Mon, 6 Jan 2025 21:56:20 +0000 Subject: [PATCH 2/4] Fix script --- bump-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bump-version.sh b/bump-version.sh index ceab2e65..a154d82c 100755 --- a/bump-version.sh +++ b/bump-version.sh @@ -35,7 +35,7 @@ cd ../backend/sync_lib wasm-pack build --target web --features console_error_panic_hook npm install -cd .. +cd ../.. cp plugin/manifest.json manifest.json # for BRAT, otherwise it wouldn't update # Commit and tag From a751646d2a0ade221feff81c4df8e0ed23a25fa4 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Mon, 6 Jan 2025 21:57:09 +0000 Subject: [PATCH 3/4] Fix script --- bump-version.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bump-version.sh b/bump-version.sh index a154d82c..b17842be 100755 --- a/bump-version.sh +++ b/bump-version.sh @@ -33,9 +33,11 @@ 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 ../.. +cd .. cp plugin/manifest.json manifest.json # for BRAT, otherwise it wouldn't update # Commit and tag From d5c2d1ecbeb45338cedc95110222bca525b4060d Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Mon, 6 Jan 2025 21:57:15 +0000 Subject: [PATCH 4/4] Bump versions to 0.0.17 --- backend/Cargo.lock | 8 ++++---- backend/fuzz/Cargo.toml | 2 +- backend/reconcile/Cargo.toml | 2 +- backend/sync_lib/Cargo.toml | 2 +- backend/sync_server/Cargo.toml | 2 +- manifest.json | 2 +- plugin/manifest.json | 2 +- plugin/package-lock.json | 6 +++--- plugin/package.json | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) 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/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": {